Search
Home
Saved
394 views
0
Upload
Sign In
RELATED TITLES
2
Training Report Uploaded by Rockers Abhi Wadhawan
Top Charts
Books
Audiobooks
Save
Embed
Share
Print
Download
Magazines
News
Documents
Sheet Music
Join
Training Report
1
of 68
MySQL- PHP PPT
PHP
Search document
A TRAINING REPORT ON
Php with Mysql
In the Sign up to vote on this title Partial Fulfillment of the requirement for the award of Useful Not useful B. Tech. C.S.E. -7TH SEMESTER
Home
Saved
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Upload
Sign In
Join
Search
Home
Saved
0
394 views
Sign In
Upload
RELATED TITLES
2
Training Report Uploaded by Rockers Abhi Wadhawan
Top Charts
Books
Audiobooks
Save
Embed
Share
Print
Download
Magazines
News
Documents
Sheet Music
Join
Training Report
1
of 68
MySQL- PHP PPT
PHP
Search document
ACKNOWLEDGEMENT
We wish to express our heartiest gratitude to H.O.D. Mr. V Parkash for their proper guidance, constant encouragement, constructive suggestions, thought provoking decisions and for giv us full opportunity to practically handle the system, without wh supervision this could not be possible.
We also take the privilege to pay our deepest appreciation a heartiest thanks to Ms Seema Sharma whose constant guidance is unbounded source of inspiration for us.
We own a great debt of gratitude towards our honorable Manjeet Singh whose invaluable expert suggestions, at cru junctures set our thinking on right right track.
Sign up to vote on this title
Useful
Not useful
Home
Saved
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Upload
Sign In
Join
Search
Home
Saved
0
394 views
Sign In
Upload
RELATED TITLES
2
Training Report Uploaded by Rockers Abhi Wadhawan
Top Charts
Books
Audiobooks
Save
Embed
Share
Print
Download
Magazines
News
Documents
Sheet Music
Join
Training Report
1
of 68
MySQL- PHP PPT
PHP
Search document
ACKNOWLEDGEMENT
We wish to express our heartiest gratitude to H.O.D. Mr. V Parkash for their proper guidance, constant encouragement, constructive suggestions, thought provoking decisions and for giv us full opportunity to practically handle the system, without wh supervision this could not be possible.
We also take the privilege to pay our deepest appreciation a heartiest thanks to Ms Seema Sharma whose constant guidance is unbounded source of inspiration for us.
We own a great debt of gratitude towards our honorable Manjeet Singh whose invaluable expert suggestions, at cru junctures set our thinking on right right track.
Sign up to vote on this title
Useful
Not useful
Home
Saved
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Upload
Sign In
Join
Search
Home
Saved
394 views
0
Sign In
Upload
RELATED TITLES
2
Training Report Uploaded by Rockers Abhi Wadhawan
Top Charts
Books
Audiobooks
Save
Embed
Share
Print
Download
Magazines
News
Documents
Sheet Music
Join
Training Report
1
of 68
MySQL- PHP PPT
PHP
Search document
CERTIFICATE
Sign up to vote on this title
Useful
Not useful
Home
Saved
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Upload
Sign In
Join
Search
Home
Saved
394 views
0
Upload
Sign In
RELATED TITLES
2
Training Report Uploaded by Rockers Abhi Wadhawan
Top Charts
Books
Audiobooks
Save
Embed
Share
Print
Magazines
News
Documents
Sheet Music
Training Report
1
Download
Join
of 68
MySQL- PHP PPT
PHP
Search document
CONTENTS Topic
Page
ACKNOWLEDGEMENT
Certificate
Php Course
Php introduction…………………………………………………………
Php installation. …………………………………………………………
Php syntax…………………………………………………………....
Php variables……………………………………………………………
Php string………………………………………………………….... ....
Php operators…………………………………………………….……..
Php if-else………………………………………………………..…….
You're Reading a Preview
Unlock full access with a free trial.
Php switch…………………………………………………………...
Download With Free Trial Php arrays…………………………………………………………... ....
Php loops………………………………………………………….……
Php functions……………………………………………………..…….
Php forms………………………………………………………………
Php $_POST & $_GET………………………………………………… Sign up to vote on this title
Php SESSION ………………………………………………………… Useful Not useful
Php mail………………………………………………………………
Home
Saved
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Upload
Sign In
Join
Search
Home
Saved
394 views
0
Sign In
Upload
RELATED TITLES
2
Training Report Uploaded by Rockers Abhi Wadhawan
Top Charts
Books
Audiobooks
Save
Embed
Share
Print
Download
Magazines
News
Documents
Sheet Music
Join
Training Report
1
of 68
MySQL- PHP PPT
PHP
Search document
Mysql ORDER BY……………………………………………………
Mysql DELETE………………………………………………………
You're Reading a Preview Unlock full access with a free trial.
Download With Free Trial
Sign up to vote on this title
Useful
Not useful
Home
Saved
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Upload
Sign In
Join
Search
Home
Saved
394 views
0
Sign In
Upload
RELATED TITLES
2
Training Report Uploaded by Rockers Abhi Wadhawan
Top Charts
Books
Audiobooks
Save
Embed
Share
Print
Magazines
News
Documents
Sheet Music
Training Report
1
Download
Join
of 68
MySQL- PHP PPT
PHP
Search document
What is PHP?
PHP stands for PHP: Hypertext Preprocessor PHP is a server-side scripting language, like ASP PHP scripts are executed on the server PHP supports many databases (Mysql, Informix, Oracle, Sybase, Solid, PostgreSQL, Generic ODBC, etc.)
PHP is an open source software PHP is free to download and use
What is a PHP File?
PHP files can contain text, HTML tags and scripts You're Reading a Preview
PHP files are returned to the browser as plain HTML Unlock full access with a free trial.
PHP files have a file extension of ".php", ".php3", or ".phtml" Download With Free Trial
PHP is a general-purpose server-side Sign up to vote on this title
scripting language originally designed for Web development to
Useful
Not useful
produce dynamic Web pages. It is one of the first developed server
Home
Saved
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Upload
Sign In
Join
Search
Home
Saved
394 views
0
Sign In
Upload
Join
RELATED TITLES
2
Training Report Uploaded by Rockers Abhi Wadhawan
Top Charts
Books
Audiobooks
Save
Embed
Share
Print
Magazines
News
Documents
Sheet Music
Training Report
1
Download
of 68
MySQL- PHP PPT
PHP
Search document
Web servers and also as a standalone shell on almost every operatin system and platform free of charge.
[3]
A competitor
to Microsoft's Active Server Pages (ASP) server-side script engine
[4]
and similar languages, PHP is installed on more than 20 [5]
million Web sites and 1 million Web servers.
Software that uses
PHP includes Media Wiki, Joomla, Word press, Concrete5, MyBB andDrupal. PHP was originally created by Rasmus Lerdorf in 1995. The main implementation of PHP is now produced by The PHP Group and [6]
serves as the formal reference to the PHP language. PHP is free
software released under the PHP License, which is incompatible wi You're Reading a Preview the GNU General Public License (GPL) Unlock full access with a free trial.
Download With Free Trial
Sign up to vote on this title
Useful
Not useful
Home
Saved
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Upload
Sign In
Join
Search
Home
Saved
394 views
0
Sign In
Upload
Join
RELATED TITLES
2
Training Report Uploaded by Rockers Abhi Wadhawan
Top Charts
Books
Audiobooks
Save
Embed
Share
Print
Magazines
News
Documents
Sheet Music
Training Report
1
Download
of 68
MySQL- PHP PPT
PHP
Search document
For installing php we either install local host server (A M P) or inst Php, Mysql, Apache, and Phpmyadmin manually. Method 1:
To install local host server AMP, there are many distributio from different manufacturer.
For Windows there are WAMP, XAMP
For Mac there are MAMP,
For Linux there LAMP servers are available for download.
Just install with administrator rights. You're Reading a Preview
Now open AMP (Apache,Unlock mysql, php) server and check for full access with a free trial.
installation by opening up browser and typing local host or 127.0.0 Download With Free Trial
Then you will see the welcome message of local host. There is a file for configuration of all php handling that is php.ini located in the php folder in the server root directory. Sign up to vote on this title
Useful
Not useful
Home
Saved
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Upload
Sign In
Join
Search
Home
Saved
394 views
0
Sign In
Upload
RELATED TITLES
2
Training Report Uploaded by Rockers Abhi Wadhawan
Top Charts
Books
Audiobooks
Save
Embed
Share
Print
Download
Magazines
News
Documents
Sheet Music
Join
Training Report
1
of 68
MySQL- PHP PPT
PHP
Search document
Basic PHP Syntax A PHP script always starts with . A PHP script can be placed anywhere in the document. On servers with shorthand-support, you can start a PHP script with and end with ?>.
For maximum compatibility, we recommend that you use the stand form ( You're Reading a Preview A PHP file must have a .php extension. Unlock full access with a free trial.
A PHP file normally contains HTML tags, and some PHP scripting Download With Free Trial code.
Below, we have an example of a simple PHP script that sends the te "Hello World" back to the browser: Sign up to vote on this title
Useful
Not useful
Home
Saved
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Upload
Sign In
Join
Search
Home
Saved
0
394 views
Sign In
Upload
RELATED TITLES
2
Training Report Uploaded by Rockers Abhi Wadhawan
Top Charts
Books
Audiobooks
Save
Embed
Share
Print
Download
Magazines
News
Documents
Sheet Music
Join
Training Report
1
of 68
MySQL- PHP PPT
PHP
Search document
Each code line in PHP must end with a semicolon. The semicolon i separator and is used to distinguish one set of instructions from another. There are two basic statements to output text with PHP: echo and print.
In the example above we have used the echo statement to output th text "Hello World".
Comments PHP You're Reading ain Preview Unlock full access with a free trial.
In PHP, we use // to make a one-line comment or /* and */ to make Download With Free Trial comment block:
Sign up to vote on this title
/*
Useful
Not useful
Home
Saved
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Upload
Sign In
Join
Search
Home
Saved
394 views
0
Sign In
Upload
RELATED TITLES
2
Training Report Uploaded by Rockers Abhi Wadhawan
Top Charts
Books
Audiobooks
Save
Embed
Share
Print
Magazines
News
Documents
Sheet Music
Training Report
1
Download
Join
of 68
MySQL- PHP PPT
PHP
Search document
PHP Variables
As with algebra, PHP variables are used to hold values or expressio
A variable can have a short name, like x, or a more descriptive nam like carName. Rules for PHP variable names:
Variables in PHP starts with a $ sign, followed by the name o the variable
The variable name must begin with a letter or the underscore character
A variable name can only contain alpha-numeric characters You're Reading a Preview
underscores (A-z, 0-9, and _ ) Unlock full access with a free trial.
A variable name should not contain spaces Download With Free Trial
Variable names are case sensitive (y and Y are two different variables
Sign up to vote on this title
Creating (Declaring) PHP Variables
Useful
Not useful
Home
Saved
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Upload
Sign In
Join
Search
Home
Saved
394 views
0
Upload
Sign In
RELATED TITLES
2
Training Report Uploaded by Rockers Abhi Wadhawan
Top Charts
Books
Audiobooks
Save
Embed
Share
Print
Download
Magazines
News
Documents
Sheet Music
Join
Training Report
1
of 68
MySQL- PHP PPT
PHP
Search document
After the execution of the statement above, the variable myCar wil hold the value Volvo.
Tip: If you want to create a variable without assigning it a value, th you assign it the value of null.
Let's create a variable containing a string, and a variable containing number: You're Reading a Preview
access with trial. Note: When you assign a Unlock text full value to aafree variable, put quotes around
the value.
Download With Free Trial
PHP is a Loosely Typed Language
In PHP, a variable does not need to be declared before adding a val Sign up to vote on this title to it. Useful Not useful
In the example above, notice that we did not have to tell PHP which
Home
Saved
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Upload
Sign In
Join
Search
Home
Saved
394 views
0
Sign In
Upload
RELATED TITLES
2
Training Report Uploaded by Rockers Abhi Wadhawan
Top Charts
Books
Audiobooks
Save
Embed
Share
Print
Magazines
News
Documents
Sheet Music
Training Report
1
Download
Join
of 68
MySQL- PHP PPT
PHP
Search document
PHP Variable Scope The scope of a variable is the portion of the script in which the variable can be referenced. PHP has four different variable scopes:
local global static parameter
Local Scope
A variable declared within a PHP function is local and can only be accessed within that function. (the variable has local scope):
You're Reading a Preview Unlock full access with a free trial.
Download With Free Trial
Sign up to vote on this title
Useful
Not useful
The script above will not produce any output because the echo statement refers to the local scope variable $a, which has not been
Home
Saved
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Upload
Sign In
Join
Search
Home
Saved
394 views
0
Sign In
Upload
RELATED TITLES
2
Training Report Uploaded by Rockers Abhi Wadhawan
Top Charts
Books
Audiobooks
Save
Embed
Share
Print
Download
Magazines
News
Documents
Sheet Music
Join
Training Report
1
of 68
MySQL- PHP PPT
PHP
Search document
Global Scope Global scope refers to any variable that is defined outside of any function. Global variables can be accessed from any part of the script that is inside a function. To access a global variable from within a function, use the global keyword:
You're Reading a Preview Unlock full access with a free trial.
function myTest()
Download With Free Trial
{ global $a, $b; $b = $a + $b; }
Sign up to vote on this title
Useful
Not useful
Home
Saved
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Upload
Sign In
Join
Search
Home
Saved
394 views
0
Sign In
Upload
RELATED TITLES
2
Training Report Uploaded by Rockers Abhi Wadhawan
Top Charts
Books
Audiobooks
Save
Embed
Share
Print
Download
Magazines
News
Documents
Sheet Music
Join
Training Report
1
of 68
MySQL- PHP PPT
PHP
Search document
PHP also stores all global variables in an array called
$GLOBALS[index]. Its index is the name of the variable. This arra is also accessible from within functions and can be used to update global variables directly. The example above can be rewritten as this:
function myTest() {
You're Reading a Preview
Unlock full access with a free trial. $GLOBALS['b'] = $GLOBALS['a'] + $GLOBALS['b'];
}
Download With Free Trial
myTest(); echo $b; ?>
Sign up to vote on this title
Useful
Not useful
Home
Saved
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Upload
Sign In
Join
Search
Home
Saved
394 views
0
Sign In
Upload
RELATED TITLES
2
Training Report Uploaded by Rockers Abhi Wadhawan
Top Charts
Books
Audiobooks
Save
Embed
Share
Print
Download
Magazines
News
Documents
Sheet Music
Join
Training Report
1
of 68
MySQL- PHP PPT
PHP
Search document
Php String There is only one string operator in PHP. The concatenation operator (.) is used to put two string values together.
To concatenate two string variables together, use the concatenation operator:
You're Reading a Preview Unlock full access with a free trial.
Download With Free Trial The output of the code above will be:
Hello World! What a nice day!
If we look at the code above you see that we used the concatenation
Sign to vote onathis title string (a operator two times. This is because we had toupinsert third
Useful
space character), to separate the two strings.
Not useful
Home
Saved
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Upload
Sign In
Join
Search
Home
Saved
394 views
0
Sign In
Upload
Join
RELATED TITLES
2
Training Report Uploaded by Rockers Abhi Wadhawan
Top Charts
Books
Audiobooks
Save
Embed
Share
Print
Download
Magazines
News
Documents
Sheet Music
Training Report
1
of 68
MySQL- PHP PPT
PHP
Search document
The strlen() function
The strlen() function is used to return the length of a string. Let's find the length of a string: The output of the code above will be: 12
The length of a string is often used in loops or other functions, whe is important to know when the string ends. (i.e. in a loop, we would want to stop the loop after the last character in the string). You're Reading a Preview
The strpos() function
Unlock full access with a free trial.
The strpos() function is used to search forTrial a character/text within a Download With Free string.
If a match is found, this function will return the character position o the first match. If no match is found, it will return FALSE. Let's see if we can find the string "world" in our string: Sign up to vote on this title
Useful
Not useful
Home
Saved
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Upload
Sign In
Join
Search
Home
Saved
394 views
0
Sign In
Upload
RELATED TITLES
2
Training Report Uploaded by Rockers Abhi Wadhawan
Top Charts
Books
Audiobooks
Save
Embed
Share
Print
Download
Magazines
News
Documents
Sheet Music
Join
Training Report
1
of 68
MySQL- PHP PPT
PHP
Search document
PHP Operators The assignment operator = is used to assign values to variables in PHP. The arithmetic operator + is used to add values together.
Arithmetic Operators The table below lists the arithmetic operators in PHP:
Operator Name x+y Addition
Description Sum of x and y
Example 2+2
Resu 4
x-y
Subtraction
Difference of x and y
5-2
3
x*y
Multiplication Product of x and y 5 * 2
10
x/y
Division
Quotient of axPreview and 15 / 5 You're Reading y full access with a free trial. Unlock
3
x%y
Modulus
Remainder of x 5%2 Download With Free Trial divided by y 10 % 8 10 % 2
1 2 0
-x
Negation
Opposite of x
a.b
Concatenation Concatenate two strings
Assignment Operators
-2 "Hi" . "Ha"
Sign up to vote on this title
Useful
HiHa
Not useful
The basic assignment operator in PHP is "=". It means that the left
Home
Saved
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Upload
Sign In
Join
Search
Home
Saved
394 views
0
Sign In
Upload
Join
RELATED TITLES
2
Training Report Uploaded by Rockers Abhi Wadhawan
Top Charts
Books
Audiobooks
Save
Embed
Share
Print
Training Report
1
Download
Magazines
News
Documents
Sheet Music
of 68
MySQL- PHP PPT
PHP
Search document
x *= y
x=x*y
Multiplication
x /= y
x=x/y
Division
x %= y
x = x % y Modulus
a .= b
a=a.b
Concatenate two strings
Incrementing/Decrementing Operators
Operator Name
Description
++ x
Preincrement
Increments x by one, then returns x
x ++
Postincrement
Returns x, then increments x by one
-- x
Predecrement
Decrements x by one, then returns x
x --
Postdecrement
Returns x, then decrements x by one You're Reading a Preview Unlock full access with a free trial.
Comparison Operators
Download With Free Trial
Comparison operators allows you to compare two values:
Operator Name
Description
Example
x == y
Equal
True if x is equal to y
5==8 returns false
x === y
Identical
True if x is equal to y, 5==="5" returns Sign up to vote on this title and they are of same false Useful Not useful type
Not equal
True if
!=
is not equal to 5!=8 returns true
Home
Saved
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Upload
Sign In
Join
Search
Home
Saved
0
394 views
Sign In
Upload
RELATED TITLES
2
Training Report Uploaded by Rockers Abhi Wadhawan
Top Charts
Books
Audiobooks
Save
Embed
Share
Print
Magazines
News
Documents
Sheet Music
Training Report
1
Download
Join
of 68
MySQL- PHP PPT
PHP
Search document
y x
Less than
True if x is less than y
5<8 returns true
x >= y
Greater than True if x is greater than 5>=8 returns false or equal to or equal to y
x <= y
Less than or True if x is less than or 5<=8 returns true equal to equal to y
Logical Operators
Operator Name
Description
Example
x and y
And
True if both x and y are x=6 true y=3 (x < 10 and y > 1) returns true
x or y
Or
True if either or both x and y are true You're Reading a Preview Unlock full access with a free trial.
x=6 y=3 (x==6 or y==5) returns true
x xor y
Xor
True if either x or y is Download Withboth Free Trial true, but not
x && y
And
True if both x and y are x=6 true y=3 (x < 10 &&y > 1 Sign up to vote on this title returns true
x || y
Or
Useful
True if either or both x and y are true
x=6 y=3 (x==6 xor y==3) returns false
Not useful
x=6 y=3
Home
Saved
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Upload
Sign In
Join
Search
Home
Saved
394 views
0
Upload
Sign In
Join
RELATED TITLES
2
Training Report Uploaded by Rockers Abhi Wadhawan
Top Charts
Books
Audiobooks
Save
Embed
Share
Print
Download
Magazines
News
Documents
Sheet Music
Training Report
1
of 68
MySQL- PHP PPT
PHP
Search document
Php if-else condition
Conditional statements are used to perform different actions based different conditions.
Conditional Statements Very often when you write code, you want to perform different actions for different decisions. You can use conditional statements in your code to do this. In PHP we have the following conditional statements:
if statement - use this statement to execute some code only if specified condition is true if...else statement - use this statement to execute some code i condition is true and another code if the condition is false if...elseif....else statement - use this statement to select one of You're Reading a Preview several blocks of code to be executed Unlock full access with a free trial. switch statement - use this statement to select one of many blocks of code to be Download executed With Free Trial
The if Statement Use the if statement to execute some code only if a specified condition is true. Sign up to vote on this title
Syntax Useful Not useful if (condition) code to be executed if condition is true;
Home
Saved
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Upload
Sign In
Join
Search
Home
Saved
394 views
0
Upload
Sign In
RELATED TITLES
2
Training Report Uploaded by Rockers Abhi Wadhawan
Top Charts
Books
Audiobooks
Save
Embed
Share
Print
Download
Magazines
News
Documents
Sheet Music
Join
Training Report
1
of 68
MySQL- PHP PPT
PHP
Search document
if ($d=="Fri") echo "Have a nice weekend!"; ?> Notice that there is no ..else.. in this syntax. The code is executed only if the specified condition is true.
The if...else Statement
Use the if....else statement to execute some code if a condition is tru and another code if a condition is false. Syntax if (condition) {
You're Reading a Preview code to be executed if condition is true;
} else {
Unlock full access with a free trial.
Download With Free Trial
code to be executed if condition is false;
} Example The following example will output "HaveSign a nice weekend!" if the up to vote on this title current day is Friday, otherwise it will output "Have a useful nice day!": Useful Not
Home
Saved
Top Charts
Books
Audiobooks
Magazines
News
Documents
Sheet Music
Upload
Sign In
Join