Documente Academic
Documente Profesional
Documente Cultură
A
Industrial Training Report
Submitted in partial fulfillment of the requirement for the award of Degree of
B.Com(Computer Application)
BARKATULLAH UNIVERSITY
BHOPAL (M.P)
Submitted By
Shubham Chouskey
14150901
Date:16/03/2016
Place:Bhopal
This is to certify that Subham Chouskey has completed the Industrial Training in
our Organization Cybercops Info Solution, Bhopal (M.P.) during the academic
year 2014-2015. He/she was trained in the field of “X-HTML, PHP & MY
SQL”. His overall performance during the period was good. We wish him great
success in future.
(IT Manager)
Before, we get into the depth of the things we would like to add heartfelt words for the
people who at various stages of the project development helped us by their valuable
guidance.
We take this opportunity to express our deep sense of gratitude and indebtedness to
Ms Rajinder kaur, Computer Science Department of our college, for his continuous
guidance, support and encouragement throughout the course of this entire project.
Also a special thanks to all other staff members and colleagues for their help and
suggestion, which they have always towards us whenever we were in trouble.
Last but not the least we would like to express our gratitude to our parents without
whose help and blessings we can’t take a single step in the right direction.
Thanks!
INDEX
4 Area of internship
5 Internship Activities
6 An assessment of the
Internship
7 Conclusion
8 References
A glance at internship Detail
Our Vision
About Cybercops
Network Consultancy projects help the students working in live projects and helps us
in getting our students placed in different companies.
Cybercops Info Solution offers a wide range of Networking Courses and Trainings
from top Computer Programming and Networking companies such as Oracle, Cisco
Systems, Microsoft, Linux, CheckPoint, etc to help students and Professionals to
develop a deep understanding into the workings of software development and
Internetworks and also helping them successfully passing Networking industry's
leading Certifications like OCJP,PHP Certification, .net Certification, CCIE, CCNP,
CCNA,CSPFA, CCSP, MCITP, MCSE, RHCE, RHCSS,CEH,CISA,CISSP and many
more.
At Cybercops Info Solution the students are very well guided and recommended for the
best program for their successful career growth.
Area of internship
WEB SITE
A Web site is a related collection of World Wide Web (WWW) files that includes a
beginning file called a home page. A company or an individual tells you how to get to
their Web site by giving you the address of their home page. From the home page,
you can get to all the other pages on their site. For example, the Web site for IBM has
the home page address of http://www.ibm.com. (The home page address actually
includes a specific file name like index.html but, as in IBM's case, when a standard
default name is set up, users don't have to enter the file name.) IBM's home page
address leads to thousands of pages. (But a Web site can also be just a few pages.)
2.Dynamic website
A dynamic website is one that changes or customizes itself frequently and
automatically. Server-side dynamic pages are generated "on the fly" by computer
code that produces the HTML (CSS are responsible for appearance and thus, are static
files). There are a wide range of software systems, such as CGI, Java Servest and Java
Server Pages (JSP), Active Server Pages and ColdFusion (CFML) that are available to
generate dynamic web systems and dynamic sites. Various web application
frameworks and web template systems are available for general-use programming
languages like Perl, PHP, Python and Ruby to make it faster and easier to create
complex dynamic web sites.
INTRODUCTION OF HTML
Building Static Sites through HTML
The tags are what separate normal text from HTML code. You might know
them as the words between the <angle-brackets>. They allow all the cool stuff like
images and tables and stuff, just by telling your browser what to render on the page.
Different tags will perform different functions. The tags themselves don’t appear
when you view your page through a browser, but their effects do. The simplest tags
do nothing more than apply formatting to some text, like this:
INTRODUCTION OF PHP
PHP - What is it?
Taken directly from PHP's home, PHP.net, "PHP is an HTML-embedded scripting
language. Much of its syntax is borrowed from C, Java and Perl with a couple of
unique PHP-specific features thrown in. The goal of the language is to allow web
developers to write dynamically generated pages quickly." This is generally a good
definition of PHP. However, it does contain a lot of terms you may not be used to.
Another way to think of PHP is a powerful, behind the scenes scripting language that
your visitors won't see!
• PHP is an acronym for "PHP: Hypertext Preprocessor"
• PHP code are executed on the server, and the result is returned to the
browser as plain HTML
Why PHP?
• PHP runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.)
• PHP is compatible with almost all servers used today (Apache, IIS, etc.)
It is also helpful to think of PHP in terms of what it can do for you. PHP will allow
you to:
• Reduce the time to create large websites.
• Create a customized user experience for visitors based on information that
you have gathered from them.
• Open up thousands of possibilities for online tools. Check out PHP -
HotScripts for examples of the great things that are possible with PHP
• Allow creation of shopping carts for e-commerce websites.
PHP – Syntax
Before we talk about PHP's syntax, let us first define what syntax is referring to.
Syntax - The rules that must be followed to write properly structured code.
INTRODUTION OF MY SQL
My SQL is currently the most popular open source database server in
existence. On top of that, it is very commonly used in conjunction with PHP scripts to
create powerful and dynamic server-side applications.
What is a database?
Databases are most useful when it comes to storing information that fits
into logical categories. For example, say that you wanted to store information of all
the employees in a company. With a database you can group different parts of your
business into separate tables to help store your information logically.
My SQL connect
Before you can do anything with My SQL in PHP you must first establish a
connection to your web host's My SQL database. This is done with the My SQL
connect function.
mysql_connect()
Syntax
<html>
<body>Hello,
How are you.
</body>
</html>
Example Explained
• The text between <html> and </html> describes the web page
• The text between <body> and </body> is the visible page content
This is the common structure of all the HTML Web Pages. Always you have
to Start the HTML Page with opening HTML and Body Tags <html> and <body> and
after putting all the content you need in the Web Page, You need to close the opened
tags by </body> and </html>, in the order they were opened.
HTML Elements.
An HTML element is everything from the start tag to the end tag.
Illustration
<p>This is Some Content.</p>
Illustration Explained
Here everything for start paragraph tag to end tag is the HTML Element. The
content between the tags “This is Some Content.” is known as the element content.
There are six levels of headings in HTML specified by <H1>, <H2>, <H3>, <H4>, <H5>
and <H6>tags. <h1> defines the largest heading and <h6> defines the smallest heading.
Illustration
<html>
<body>
</body></html>
Illustration Output
We will now discuss some other useful tags like HTML Rules, HTML Comments, Line
Breaks etc.
<HR> (Horizontal Rule) is a stand alone tag that generates a horizontal line. There is
no corresponding HTML command for a vertical line.
Illustration
<html>
<body>
<hr>
</body>
</html>
Illustration Output.
HTML Comments
All combinations of text placed within the comment tags will be ignored by the web
browser, this includes any HTML tags, scripting language(s), etc. Comment tags <!--
and --> are used to insert comments in HTML.
Example
<!-- Write your comments here -->
Line Breaks
To break the line and move to the next line. Use the <br> tag.
Marquee
An HTML marquee is a scrolling piece of text displayed either horizontally across or
vertically down your webpage depending on the settings. This is created by using
HTML <marquees> tag.
<!DOCTYPE html>
<html>
<head>
<title>HTML marquee Tag</title>
</head>
<body>
<marquee>This is basic example of marquee</marquee>
<marquee direction="up">The direction of text will be from bottom to
top.</marquee>
</body>
</html>
You may want to change the way the generated HTML output
looks. The best way to do that is with a Cascading Style Sheet (CSS), which
modern browsers support. Font family, type size, colors, and other styles can be
controlled with CSS for each kind of element.
Illustration
Illustration Explained
The above tag, links the CSS file named “stylesheet.css” to the
current Web page.
CSS Syntax
element { property:value; property:value }
Example
<h1 style="color:blue">This is a Blue Heading</h1>
<!DOCTYPE html>
<html>
<head>
<style>
body {background-color:lightgrey}
h1 {color:blue}
p {color:green}
</style>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
With external style sheets, you can change the look of an entire web site by changing
one file.
External styles are defined in an external CSS file, and then linked to in
the <head> section of an HTML page:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
Text Formatting
HTML uses elements like <b> and <i> for formatting output,
like bold or italic text.
• Important text
• Italic text
• Emphasized text
• Marked text
• Small text
• Deleted text
• Inserted text
• Subscripts
• Superscripts
HTML Links
HTML links are useful to interconnected the HTML pages.Links are found in
nearly all web pages. Links allow users to click their way from page to page.
HTML links are hyperlinks.
A hyperlink is a text or an image you can click on, and jump to another document.
In HTML, links are defined with the <a> tag:
Syntax
<a href="url">link text</a>
Example
<a href="http://cybercopsinfosolutions">Visit our HTML tutorial</a>
HTML Table Tags
The <table> tag defines an HTML table. A simple HTML table consists of
the table element and one or more tr, th, and td elements. The tr element defines a
table row, the th element defines a table header, and the td element defines a table
cell.
Example
<!DOCTYPE html>
<html>
<body>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
<td>80</td>
</tr>
</table>
</body>
</html>
Illustration Output.
Words or phrases which need to be set apart from the rest of the body of text can be
emphasized with a “bullet”.
List Tag
<LI>: creates a bullet in front of text which is to be set apart for emphasis and causes
all text after it to be indented, either until another list tag is detected or until the end
of the list is reached. It is used to itemize elements of “unordered” and “ordered”
lists.
Unordered List
An unordered list is a list of items. The list items are marked with bullets (typically
small black circles).
An unordered list starts with the <ul> tag. Each list item starts with the <li> tag.
Illustration
<html>
<body>
<ul><li>January</li>
<li>February</li>
</ul>
</body>
</html>
Illustration Output
January & February are put in Bullet as they are inside an <ul> unordered
list tags.
Ordered List
An ordered list is also a list of items. The list items are marked with numbers. An
ordered list starts with the <ol> tag. Each list item starts with the <li> tag.
Illustration
<html>
<body>
<ol><li>January</li>
<li>February</li>
</ol>
</body>
</html>
Illustration Output
A form is an area that can contain form elements. Form elements are elements that
allow the user to enter information (like text fields, textarea fields, drop-down menus,
radio buttons, checkboxes, etc.) in a form. A form is defined with the <form> tag.
<!DOCTYPE html>
<html>
<body>
<form action="action_page.php">
First name:<br>
<br>
Last name:<br>
<input type="text" name="lastname" value="Mouse">
<br><br>
</form>
<p>If you click the "Submit" button, the form-data will be sent to a page called
"action_page.php".</p>
</body>
</html>
Illustration Output
Textfield
Text fields are used when you want the user to type letters, numbers, etc. in a form.
Raadio Button
Radio Buttons are used when you want the user to select one of a limited number of
choices.
Checkbox
Checkboxes are used when you want the user to select one or more options of a
limited number of choices.
Block-level Elements
A block-level element always starts on a new line and takes up the full width available
(stretches out to the left and right as far as it can).
Examples of block-level elements:
• <div>
• <h1> - <h6>
• <p>
• <form>
Inline Elements
An inline element does not start on a new line and only takes up as much width as
necessary.
The <div> tag in XHTML is a tag that defines logical divisions within the
content of a page. What this means is that a <div> tag defines sections of a Web page
to make it easier to manage, style, and manipulate.
Illustration Output
We can then give any design or position to the easily to the <div> using the CSS.
HTML Images
The <img> tag is empty, it contains attributes only, and does not have a closing tag.
The src attribute specifies the URL (web address) of the image:
<img src="url" alt="some text">
The alt attribute provides alternative information for an image if a user for some
reason cannot view it (because of slow connection, an error in the src attribute, or if
the user uses a screen reader).
<img src="image.gif" alt="HTML5 Icon" style="width:128px;height:128px;">
PHP Code
<?php
?>
on your server...
<?
If you have PHP inserted into your HTML and want the web browser to interpret it
correctly, then you must save the file with a .php extension, instead of the standard
.html extension. So be sure to check that you are saving your files correctly.
PHP Code
<html>
<head>
</head>
<body>
<?php
</body>
</html>Display
Hello World!
White Space
As with HTML, whitespace is ignored between PHP statements. This means it is
OK to have one line of PHP code, then 20 lines of blank space before the next line
of PHP code. You can also press tab to indent your code .
<head>
</head>
<body>
<?php
</body>
</html>
Display
PHP Variables
If you forget that dollar sign at the beginning, it will not work. This is a common
mistake for new PHP programmers!
PHP Variable Naming Conventions
There are a few rules that you need to follow when choosing a name for your PHP
variables.
- PHP variables must start with a letter or underscore "_".
- PHP variables may only be comprised of alpha-numeric characters and
underscores. a-z, A-Z, 0-9, or
- Variables with more than one word should be separated with underscores.
$my_variable
- Variables with more than one word can also be distinguished with capitalization.
$myVariable
Decision making statements allow you to control execution of certain part of the
code based on the outcome of the condition at run time.
• Simple If Statement
• If…else Statement
• Nested If statement
• If…elseif Ladder
• Switch…Case Statement
• if...else statement − use this statement if you want to execute a set of code
when a condition is true and another if the condition is not true
• elseif statement − is used with the if...else statement to execute a set of code
if one of the several condition is true
• switch statement − is used if you want to select one of many blocks of code to
be executed, use the Switch statement. The switch statement is used to avoid
long blocks of if..elseif..else code.
PHP Echo
As you saw in the previous lesson, the PHP function echo is a means of outputting text
to the web browser. Throughout your PHP career you will be using the echo function
more than any other. So let's give it a solid perusal!
Outputting a String
To output a string, like we have done in previous lessons, use the PHP echo function.
You can place either a string variable or you can use quotes, like we do below, to
create a string that the echo function will output.
PHP Code
<?php
?>
Display
Hello!
It is pretty cool that you can output HTML with PHP. However, you must be careful
when using HTML code or any other string that includes quotes! The echo function
uses quotes to define the beginning and end of the string, so you must use one of the
following tactics if your string contains quotations:
Escape your quotes that are within the string with a slash. To escape a quote just
place a slash directly before the quotation mark, i.e. \"
See our example below for the right and wrong use of the echo function:
PHP Code
<?php
?>
PHP Strings
In the last lesson, PHP Echo, we used strings a bit, but didn't talk about them in depth.
Throughout your PHP career you will be using strings a great deal, so it is important to
have a basic understanding of PHP strings.
Illustration
<?php
$variable = "name";
print($literally);
print($literally);
?>
Illustration Output
Before you can use a string you have to create it! A string can be used directly in a
function or it can be stored in a variable.
Cookies
PHP transparently supports HTTP cookies. Cookies are a mechanism for storing data
in the remote browser and thus tracking or identifying return users. You can set
cookies using the setcookie() or setrawcookie() function.
Cookies are text files stored on the client computer and they are kept of use tracking
purpose. PHP transparently supports HTTP cookies.
• Server script sends a set of cookies to the browser. For example name, age, or
identification number etc.
• When next time browser sends any request to web server then it sends those
cookies information to the server and server uses that information to identify
the user.
Setcookie(name,value,expire,path,domain,security);
• Value −This sets the value of the named variable and is the content that you
actually want to store.
• Expiry −This specify a future time in seconds since 00:00:00 GMT on 1st Jan
1970. After this time cookie will become inaccessible. If this parameter is not
set then cookie will automatically expire when the Web Browser is closed.
• Path −This specifies the directories for which the cookie is valid. A single
forward slash character permits the cookie to be valid for all directories.
• Domain −This can be used to specify the domain name in very large domains
and must contain at least two periods to be valid. All cookies are only valid for
the host and domain which created them.
• Security − This can be set to 1 to specify that the cookie should only be sent by
secure transmission using HTTPS otherwise set to 0 which mean cookie can be
sent by regular HTTP.
PHP- Sessions
An alternative way to make data accessible across the various pages of an entire
website is to use a PHP Session.
This function first checks if a session is already started and if none is started then it
starts one. It is recommended to put the call to session_start() at the beginning of the
page.
<?php
session_start();
if(isset( $_SESSION['counter']))
{
$_SESSION['counter']+=1;
}
else
{
$_SESSION['counter']=1;
}
$msg="You have visited this page ". $_SESSION['counter'];
$msg.="in this session.";
?>
<html>
<head>
<title>Setting up a PHP session</title>
</head>
<body>
<?php echo ( $msg);?>
</body>
</html>
Output
or another page. To send submitted data through form, one can use GET & POST
A form data can be submitted using these two methods. Both are used for same
purpose but stands apart under some specifications. As in GET method key values are
GET Method
query string in URL known as Url Encoding. Which contains both page link
<?php
if( $_GET["name"]|| $_GET["age"])
{
echo"Welcome ". $_GET['name']."<br />";
echo"You are ". $_GET['age']." years old.";
exit();
}
?>
<html>
<body>
<form action="<?php$_PHP_SELF?>" method="GET">
Name: <inputtype="text"name="name"/>
Age: <inputtype="text"name="age"/>
<inputtype="submit"/>
</form>
</body>
</html>
Output
Name: Age:
POST Method
<?php
if( $_POST["name"]|| $_POST["age"])
{
if(preg_match("/[^A-Za-z'-]/",$_POST['name']))
{
die("invalid name and name should be alpha");
}
echo"Welcome ". $_POST['name']."<br/>";
echo"You are ". $_POST['age']." years old.";
exit();
}
?>
<html>
<body>
</body>
</html>
Output
Name: Age:
<?php
?>
Display:
Connected to MySQL
After establishing a MySQL connection with the code above, you then need
to choose which database you will be using with this connection. This is done with the
mysql_select_db function.
MySQL Tables
A MySQL table is completely different than the normal table that you eat dinner on. In
MySQL and other database systems, the goal is to store information in an orderly
fashion.
<?php
mysql_select_db("test") or die(mysql_error());
or die(mysql_error());
or die(mysql_error());
or die(mysql_error());
Display:
Data Inserted!
<?php
?>
The value that mysql_query returns and stores into $result is a special
type of data; it is a My SQL Resource. Additional PHP functions are required to extract
the data from this Resource.
MYSQL
MySQL Delete
<?php
// Connect to My SQL
or die(mysql_error());
?>
It is important to note that this query would have deleted ALL records
that had an age of 15. Since Bobby was the only 15 year old this was not a problem.
1.
AN ASSESSMENT OF THE INTERNSHIP
FIRST PAGE
SECOND PAGE
THIRD PAGE
FOURTH PAGE
FIFTH PAGE
SIXTH PAGE
CONCLUSION
References
1. 1.
2. www.w3schools.com/html/
3. https://en.wikipedia.org/wiki/PHP
4. http://web-source.net/html_codes_chart.htm#italic
5. http://www.quackit.com/html/codes/
6. http://www.2createawebsites.com/create-a-website-
html.php