SlideShare une entreprise Scribd logo
1  sur  39
PHP & MySQLPHP & MySQL
WebsolesTraining MaterialWebsolesTraining Material
www.websoles.comwww.websoles.com
What is PHP Used For?
PHP is a general-purpose server-side scripting language
originally designed for web development to produce
dynamic web pages
PHP can interact with MySQL databases
What is PHP?What is PHP?
PHP == ‘Hypertext Preprocessor’
Open-source, server-side scripting language
Used to generate dynamic web-pages
PHP scripts reside between reserved PHP tags
This allows the programmer to embed PHP scripts within
HTML pages
What is PHP (cont’d)What is PHP (cont’d)Interpreted language, scripts are parsed at run-time
rather than compiled beforehand
Executed on the server-side
Source-code not visible by client
‘View Source’ in browsers does not display the PHP code
Various built-in functions allow for fast development
Compatible with many popular databases
What does PHP code look like?What does PHP code look like?
Structurally similar to C/C++
Supports procedural and object-oriented paradigm (to
some degree)
All PHP statements end with a semi-colon
Each PHP script must be enclosed in the reserved PHP
tag
<?php
…
?>
Comments in PHPComments in PHP
Standard C, C++, and shell comment symbols
// C++ and Java-style comment
# Shell-style comments
/* C-style comments
These can span multiple lines */
Variables in PHPVariables in PHP
PHP variables must begin with a “$” sign
Case-sensitive ($Foo != $foo != $fOo)
Global and locally-scoped variables
Global variables can be used anywhere
Local variables restricted to a function or class
Certain variable names reserved by PHP
Form variables ($_POST, $_GET)
Server variables ($_SERVER)
Etc.
Variable usageVariable usage
<?php
$foo = 25; // Numerical variable
$bar = “Hello”; // String variable
$foo = ($foo * 7); // Multiplies foo by 7
$bar = ($bar * 7); // Invalid expression
?>
EchoEcho
The PHP command ‘echo’ is used to output the
parameters passed to it
The typical usage for this is to send data to the client’s
web-browser
Syntax
void echo (string arg1 [, string argn...])
In practice, arguments are not passed in parentheses since
echo is a language construct rather than an actual
function
Echo exampleEcho example
 Notice how echo ‘5x5=$foo’ outputs $foo rather than replacing it with 25
 Strings in single quotes (‘ ’) are not interpreted or evaluated by PHP
 This is true for both variables and character escape-sequences (such as “n” or “”)
<?php
$foo = 25; // Numerical variable
$bar = “Hello”; // String variable
echo $bar; // Outputs Hello
echo $foo,$bar; // Outputs 25Hello
echo “5x5=”,$foo; // Outputs 5x5=25
echo “5x5=$foo”; // Outputs 5x5=25
echo ‘5x5=$foo’; // Outputs 5x5=$foo
?>
Arithmetic OperationsArithmetic Operations
$a - $b // subtraction
$a * $b // multiplication
$a / $b // division
$a += 5 // $a = $a+5 Also works for *= and /=
<?php
$a=15;
$b=30;
$total=$a+$b;
Print $total;
Print “<p><h1>$total</h1>”;
// total is 45
?>
ConcatenationConcatenation
Use a period to join strings into one.
<?php
$string1=“Hello”;
$string2=“PHP”;
$string3=$string1 . “ ” .
$string2;
Print $string3;
?>
Hello PHP
Escaping the CharacterEscaping the Character
If the string has a set of double quotation marks that must
remain visible, use the  [backslash] before the quotation
marks to ignore and display them.
<?php
$heading=“”Computer Science””;
Print $heading;
?>
“Computer Science”
PHP Control StructuresPHP Control Structures
 Control Structures: Are the structures within a language that allow
us to control the flow of execution through a program or script.
 Grouped into conditional (branching) structures (e.g. if/else) and
repetition structures (e.g. while loops).
 Example if/else if/else statement:
if ($foo == 0) {
echo ‘The variable foo is equal to 0’;
}
else if (($foo > 0) && ($foo <= 5)) {
echo ‘The variable foo is between 1 and 5’;
}
else {
echo ‘The variable foo is equal to ‘.$foo;
}
If ... Else...If ... Else...
If (condition)
{
Statements;
}
Else
{
Statement;
}
<?php
If($user==“John”)
{
Print “Hello John.”;
}
Else
{
Print “You are not John.”;
}
?>
No THEN in PHP
While LoopsWhile Loops
While (condition)
{
Statements;
}
<?php
$count=0;
While($count<3)
{
Print “hello PHP. ”;
$count += 1;
// $count = $count + 1;
// or
// $count++;
?>
hello PHP. hello PHP. hello PHP.
Date DisplayDate Display
$datedisplay=date(“yyyy/m/d”);
Print $datedisplay;
# If the date is April 1st
, 2009
# It would display as 2009/4/1
2009/4/1
$datedisplay=date(“l, F m, Y”);
Print $datedisplay;
# If the date is April 1st
, 2009
# Wednesday, April 1, 2009
Wednesday, April 1, 2009
Month, Day & Date FormatMonth, Day & Date Format
SymbolsSymbols
M Jan
F January
m 01
n 1
Day of Month d 01
Day of Month J 1
Day of Week l Monday
Day of Week D Mon
FunctionsFunctions
Functions MUST be defined before then can be called
Function headers are of the format
Note that no return type is specified
Unlike variables, function names are not case sensitive (foo(…)
== Foo(…) == FoO(…))
function functionName($arg_1, $arg_2, …, $arg_n)
Functions exampleFunctions example
<?php
// This is a function
function foo($arg_1, $arg_2)
{
$arg_2 = $arg_1 * $arg_2;
return $arg_2;
}
$result_1 = foo(12, 3); // Store the function
echo $result_1; // Outputs 36
echo foo(12, 3); // Outputs 36
?>
Include FilesInclude FilesInclude “opendb.php”;
Include “closedb.php”;
This inserts files; the code in files will be inserted into current code. This will provide
useful and protective means once you connect to a database, as well as for other
repeated functions.
Include (“footer.php”);
The file footer.php might look like:
<hr SIZE=11 NOSHADE WIDTH=“100%”>
<i>Copyright © 2008-2010 KSU </i></font><br>
<i>ALL RIGHTS RESERVED</i></font><br>
<i>URL: http://www.kent.edu</i></font><br>
PHP - FormsPHP - Forms
•Access to the HTTP POST and GET data is simple in PHPAccess to the HTTP POST and GET data is simple in PHP
•The global variables $_POST[] and $_GET[] contain theThe global variables $_POST[] and $_GET[] contain the
request datarequest data
<?php
if ($_POST["submit"])
echo "<h2>You clicked Submit!</h2>";
else if ($_POST["cancel"])
echo "<h2>You clicked Cancel!</h2>";
?>
<form action="form.php" method="post">
<input type="submit" name="submit" value="Submit">
<input type="submit" name="cancel" value="Cancel">
</form>
http://www.cs.kent.edu/~nruan/form.php
WHY PHP – Sessions ?WHY PHP – Sessions ?Whenever you want to create aWhenever you want to create a websitewebsite that allows you to store and displaythat allows you to store and display
information about a user, determine which user groups a person belongs to,information about a user, determine which user groups a person belongs to,
utilize permissions on yourutilize permissions on your websitewebsite or you just want to do something cool onor you just want to do something cool on
your site,your site, PHP's SessionsPHP's Sessions are vital toare vital to eacheach of these features.of these features.
Cookies are about 30% unreliable right now and it's getting worse every day.Cookies are about 30% unreliable right now and it's getting worse every day.
More and more web browsers are starting to come with security and privacyMore and more web browsers are starting to come with security and privacy
settings and people browsing the net these days are starting to frown uponsettings and people browsing the net these days are starting to frown upon
Cookies because they store information on their local computer that they doCookies because they store information on their local computer that they do
not want stored there.not want stored there.
PHP has a great set of functions that can achieve the same results ofPHP has a great set of functions that can achieve the same results of
Cookies and more without storing information on the user's computer. PHPCookies and more without storing information on the user's computer. PHP
Sessions store the information on the web server in a location that you choseSessions store the information on the web server in a location that you chose
in special files. These files are connected to the user's web browser via thein special files. These files are connected to the user's web browser via the
server and a special ID called a "Session ID". This is nearly 99% flawless inserver and a special ID called a "Session ID". This is nearly 99% flawless in
operation and it is virtually invisible to the user.operation and it is virtually invisible to the user.
PHP - SessionsPHP - Sessions
•Sessions store their identifier in a cookie in the client’s browserSessions store their identifier in a cookie in the client’s browser
•Every page that uses session data must be proceeded by theEvery page that uses session data must be proceeded by the
session_start()session_start() functionfunction
•Session variables are then set and retrieved by accessing the globalSession variables are then set and retrieved by accessing the global
$_SESSION[]$_SESSION[]
•Save it asSave it as session.phpsession.php
<?php<?php
session_start();session_start();
if (!$_SESSION["count"])if (!$_SESSION["count"])
$_SESSION["count"] = 0;$_SESSION["count"] = 0;
if ($_GET["count"] == "yes")if ($_GET["count"] == "yes")
$_SESSION["count"] = $_SESSION["count"] + 1;$_SESSION["count"] = $_SESSION["count"] + 1;
echo "<h1>".$_SESSION["count"]."</h1>";echo "<h1>".$_SESSION["count"]."</h1>";
?>?>
<a href="session.php?count=yes">Click here to count</a><a href="session.php?count=yes">Click here to count</a>
http://www.cs.kent.edu/~nruan/session.php
Avoid Error PHP - SessionsAvoid Error PHP - Sessions
PHP Example: <?php
echo "Look at this nasty error below:<br />";
session_start();
?>
Error!
PHP Example: <?php
session_start();
echo "Look at this nasty error below:";
?>
Correct
Warning: Cannot send session cookie - headers already sent
by (output started at
session_header_error/session_error.php:2) in
session_header_error/session_error.php on line 3
Warning: Cannot send session cache limiter - headers
already sent (output started at
session_header_error/session_error.php:2) in
session_header_error/session_error.php on line 3
Destroy PHP - SessionsDestroy PHP - Sessions
Destroying a Session
why it is necessary to destroy a session when the session will get
destroyed when the user closes their browser. Well, imagine that you
had a session registered called "access_granted" and you were using
that to determine if the user was logged into your site based upon a
username and password. Anytime you have a login feature, to make
the users feel better, you should have a logout feature as well. That's
where this cool function called session_destroy() comes in handy.
session_destroy() will completely demolish your session (no, the
computer won't blow up or self destruct) but it just deletes the session
files and clears any trace of that session.
NOTE: If you are using the $_SESSION superglobal array, you must
clear the array values first, then run session_destroy.
Here's how we use session_destroy():
Destroy PHP - SessionsDestroy PHP - Sessions
<?php
// start the session
session_start();
header("Cache-control: private"); //IE 6 Fix
$_SESSION = array();
session_destroy();
echo "<strong>Step 5 - Destroy This Session </strong><br />";
if($_SESSION['name']){
    echo "The session is still active";
} else {
    echo "Ok, the session is no longer active! <br />";
    echo "<a href="page1.php"><< Go Back Step 1</a>";
}
?>
PHP OverviewPHP Overview
Easy learning
Syntax Perl- and C-like syntax. Relatively easy to learn.
Large function library
Embedded directly into HTML
Interpreted, no need to compile
Open Source server-side scripting language designed specifically
for the web.
PHP Overview (cont.)PHP Overview (cont.)
Conceived in 1994, now used on +10 million web sites.
Outputs not only HTML but can output XML, images (JPG
& PNG), PDF files and even Flash movies all generated on
the fly. Can write these files to the file system.
Supports a wide-range of databases (20+ODBC).
PHP also has support for talking to other services using
protocols such as LDAP, IMAP, SNMP, NNTP, POP3,
HTTP.
 Save as sample.php:
<!– sample.php -->
<html><body>
<strong>Hello World!</strong><br />
<?php
echo “<h2>Hello, World</h2>”; ?>
<?php
$myvar = "Hello World";
echo $myvar;
?>
</body></html>
First PHP scriptFirst PHP script
http://www.cs.kent.edu/~nruan/sample.php
Example – show data in theExample – show data in the
tablestables
Function: list all tables in your database. Users can select one
of tables, and show all contents in this table.
second.php
showtable.php
second.phpsecond.php
<html><head><title>MySQL Table Viewer</title></head><body>
<?php
// change the value of $dbuser and $dbpass to your username and password
$dbhost = 'hercules.cs.kent.edu:3306';
$dbuser = 'nruan';
$dbpass = ‘*****************’;
$dbname = $dbuser;
$table = 'account';
$conn = mysql_connect($dbhost, $dbuser, $dbpass);
if (!$conn) {
die('Could not connect: ' . mysql_error());
}
if (!mysql_select_db($dbname))
die("Can't select database");
second.php (cont.)second.php (cont.)$result = mysql_query("SHOW TABLES");
if (!$result) {
die("Query to show fields from table failed");
}
$num_row = mysql_num_rows($result);
echo "<h1>Choose one table:<h1>";
echo "<form action="showtable.php" method="POST">";
echo "<select name="table" size="1" Font size="+2">";
for($i=0; $i<$num_row; $i++) {
$tablename=mysql_fetch_row($result);
echo "<option value="{$tablename[0]}" >{$tablename[0]}</option>";
}
echo "</select>";
echo "<div><input type="submit" value="submit"></div>";
echo "</form>";
mysql_free_result($result);
mysql_close($conn);
?>
</body></html>
showtable.phpshowtable.php<html><head>
<title>MySQL Table Viewer</title>
</head>
<body>
<?php
$dbhost = 'hercules.cs.kent.edu:3306';
$dbuser = 'nruan';
$dbpass = ‘**********’;
$dbname = 'nruan';
$table = $_POST[“table”];
$conn = mysql_connect($dbhost, $dbuser, $dbpass);
if (!$conn)
die('Could not connect: ' . mysql_error());
if (!mysql_select_db($dbname))
die("Can't select database");
$result = mysql_query("SELECT * FROM {$table}");
if (!$result) die("Query to show fields from table failed!" . mysql_error());
showtable.php (cont.)showtable.php (cont.)$fields_num = mysql_num_fields($result);
echo "<h1>Table: {$table}</h1>";
echo "<table border='1'><tr>";
// printing table headers
for($i=0; $i<$fields_num; $i++) {
$field = mysql_fetch_field($result);
echo "<td><b>{$field->name}</b></td>";
}
echo "</tr>n";
while($row = mysql_fetch_row($result)) {
echo "<tr>";
// $row is array... foreach( .. ) puts every element
// of $row to $cell variable
foreach($row as $cell)
echo "<td>$cell</td>";
echo "</tr>n";
}
mysql_free_result($result);
mysql_close($conn);
?>
</body></html>
Functions CoveredFunctions Covered
mysql_connect() mysql_select_db()
include()
mysql_query() mysql_num_rows()
mysql_fetch_array()mysql_close()
History of PHPHistory of PHP
PHP began in 1995 when Rasmus Lerdorf developed a Perl/CGI
script toolset he called the Personal Home Page or PHP
PHP 2 released 1997 (PHP now stands for Hypertex Processor).
Lerdorf developed it further, using C instead
PHP3 released in 1998 (50,000 users)
PHP4 released in 2000 (3.6 million domains). Considered debut of
functional language and including Perl parsing, with other major
features
PHP5.0.0 released July 13, 2004 (113 libraries>1,000 functions with
extensive object-oriented programming)
PHP5.0.5 released Sept. 6, 2005 for maintenance and bug fixes
Recommended Texts forRecommended Texts for
Learning PHPLearning PHP
Larry Ullman’s books from the Visual Quickpro series
PHP & MySQL for Dummies
Beginning PHP 5 and MySQL: From Novice to Professional by
W. Jason Gilmore
(This is more advanced and dense than the others, but great to read
once you’ve finished the easier books. One of the best
definition/description of object oriented programming I’ve read)
PHP ReferencesPHP References
http://www.php.net <-- php home page
http://www.phpbuilder.com/
http://www.devshed.com/
http://www.phpmyadmin.net/
http://www.hotscripts.com/PHP/
http://geocities.com/stuprojects/ChatroomDescription.htm
http://www.academic.marist.edu/~kbhkj/chatroom/chatroom.htm
http://www.aus-etrade.com/Scripts/php.php
http://www.codeproject.com/asp/CDIChatSubmit.asp
http://www.php.net/downloads <-- php download page
http://www.php.net/manual/en/install.windows.php <-- php
installation manual
http://php.resourceindex.com/ <-- PHP resources like sample
programs, text book references, etc.
http://www.daniweb.com/techtalkforums/forum17.html  php
forums

Contenu connexe

Tendances (19)

Php mysql
Php mysqlPhp mysql
Php mysql
 
Php Lecture Notes
Php Lecture NotesPhp Lecture Notes
Php Lecture Notes
 
Short Intro to PHP and MySQL
Short Intro to PHP and MySQLShort Intro to PHP and MySQL
Short Intro to PHP and MySQL
 
PHP - Introduction to PHP
PHP -  Introduction to PHPPHP -  Introduction to PHP
PHP - Introduction to PHP
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
PHP Basic
PHP BasicPHP Basic
PHP Basic
 
Class 6 - PHP Web Programming
Class 6 - PHP Web ProgrammingClass 6 - PHP Web Programming
Class 6 - PHP Web Programming
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
basic concept of php(Gunikhan sonowal)
basic concept of php(Gunikhan sonowal)basic concept of php(Gunikhan sonowal)
basic concept of php(Gunikhan sonowal)
 
Php i basic chapter 3
Php i basic chapter 3Php i basic chapter 3
Php i basic chapter 3
 
Web Development Course: PHP lecture 1
Web Development Course: PHP lecture 1Web Development Course: PHP lecture 1
Web Development Course: PHP lecture 1
 
Basic PHP
Basic PHPBasic PHP
Basic PHP
 
Php Crash Course
Php Crash CoursePhp Crash Course
Php Crash Course
 
Intro to PHP
Intro to PHPIntro to PHP
Intro to PHP
 
Intro to php
Intro to phpIntro to php
Intro to php
 
Using PHP
Using PHPUsing PHP
Using PHP
 
Intermediate PHP
Intermediate PHPIntermediate PHP
Intermediate PHP
 
Phphacku iitd
Phphacku iitdPhphacku iitd
Phphacku iitd
 
Introduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHPIntroduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHP
 

En vedette

Php Tutorial | Introduction Demo | Basics
 Php Tutorial | Introduction Demo | Basics Php Tutorial | Introduction Demo | Basics
Php Tutorial | Introduction Demo | BasicsShubham Kumar Singh
 
Best Web services tutorial | Websoles Strategic Digital Solutions
Best Web services tutorial | Websoles Strategic Digital SolutionsBest Web services tutorial | Websoles Strategic Digital Solutions
Best Web services tutorial | Websoles Strategic Digital SolutionsShubham Kumar Singh
 
Strategy of Social media
Strategy of Social mediaStrategy of Social media
Strategy of Social mediaRatnesh Pandey
 
Learning of Php and My SQL Tutorial | For Beginners
Learning of Php and My SQL Tutorial | For BeginnersLearning of Php and My SQL Tutorial | For Beginners
Learning of Php and My SQL Tutorial | For BeginnersRatnesh Pandey
 
Web services Tutorial /Websoles Strategic Digital Solutions
Web services Tutorial /Websoles Strategic Digital SolutionsWeb services Tutorial /Websoles Strategic Digital Solutions
Web services Tutorial /Websoles Strategic Digital SolutionsRatnesh Pandey
 
2015 Upload Campaigns Calendar - SlideShare
2015 Upload Campaigns Calendar - SlideShare2015 Upload Campaigns Calendar - SlideShare
2015 Upload Campaigns Calendar - SlideShareSlideShare
 
What to Upload to SlideShare
What to Upload to SlideShareWhat to Upload to SlideShare
What to Upload to SlideShareSlideShare
 
Getting Started With SlideShare
Getting Started With SlideShareGetting Started With SlideShare
Getting Started With SlideShareSlideShare
 

En vedette (12)

Web Development Company in Delhi - Websoles Strategic Digital Solutions
Web Development Company in Delhi - Websoles Strategic Digital Solutions Web Development Company in Delhi - Websoles Strategic Digital Solutions
Web Development Company in Delhi - Websoles Strategic Digital Solutions
 
Web services | Websoles
Web services | WebsolesWeb services | Websoles
Web services | Websoles
 
Php Tutorial | Introduction Demo | Basics
 Php Tutorial | Introduction Demo | Basics Php Tutorial | Introduction Demo | Basics
Php Tutorial | Introduction Demo | Basics
 
Resume_Shubham Kumar
Resume_Shubham KumarResume_Shubham Kumar
Resume_Shubham Kumar
 
Best Web services tutorial | Websoles Strategic Digital Solutions
Best Web services tutorial | Websoles Strategic Digital SolutionsBest Web services tutorial | Websoles Strategic Digital Solutions
Best Web services tutorial | Websoles Strategic Digital Solutions
 
Strategy of Social media
Strategy of Social mediaStrategy of Social media
Strategy of Social media
 
Learning of Php and My SQL Tutorial | For Beginners
Learning of Php and My SQL Tutorial | For BeginnersLearning of Php and My SQL Tutorial | For Beginners
Learning of Php and My SQL Tutorial | For Beginners
 
Web services Tutorial /Websoles Strategic Digital Solutions
Web services Tutorial /Websoles Strategic Digital SolutionsWeb services Tutorial /Websoles Strategic Digital Solutions
Web services Tutorial /Websoles Strategic Digital Solutions
 
SlideShare 101
SlideShare 101SlideShare 101
SlideShare 101
 
2015 Upload Campaigns Calendar - SlideShare
2015 Upload Campaigns Calendar - SlideShare2015 Upload Campaigns Calendar - SlideShare
2015 Upload Campaigns Calendar - SlideShare
 
What to Upload to SlideShare
What to Upload to SlideShareWhat to Upload to SlideShare
What to Upload to SlideShare
 
Getting Started With SlideShare
Getting Started With SlideShareGetting Started With SlideShare
Getting Started With SlideShare
 

Similaire à PHP & MySQL Guide for Dynamic Websites (20)

Php mysql
Php mysqlPhp mysql
Php mysql
 
Php mysql training-in-mumbai
Php mysql training-in-mumbaiPhp mysql training-in-mumbai
Php mysql training-in-mumbai
 
Php mysql
Php mysqlPhp mysql
Php mysql
 
Php mysql ppt
Php mysql pptPhp mysql ppt
Php mysql ppt
 
PHP
PHPPHP
PHP
 
Prersentation
PrersentationPrersentation
Prersentation
 
Php mysql training-in-mumbai
Php mysql training-in-mumbaiPhp mysql training-in-mumbai
Php mysql training-in-mumbai
 
WT_PHP_PART1.pdf
WT_PHP_PART1.pdfWT_PHP_PART1.pdf
WT_PHP_PART1.pdf
 
Php Tutorial
Php TutorialPhp Tutorial
Php Tutorial
 
PHP - Introduction to PHP Fundamentals
PHP -  Introduction to PHP FundamentalsPHP -  Introduction to PHP Fundamentals
PHP - Introduction to PHP Fundamentals
 
Lecture8
Lecture8Lecture8
Lecture8
 
Wt unit 4 server side technology-2
Wt unit 4 server side technology-2Wt unit 4 server side technology-2
Wt unit 4 server side technology-2
 
Php introduction
Php introductionPhp introduction
Php introduction
 
PHP: The easiest language to learn.
PHP: The easiest language to learn.PHP: The easiest language to learn.
PHP: The easiest language to learn.
 
Lecture2_IntroductionToPHP_Spring2023.pdf
Lecture2_IntroductionToPHP_Spring2023.pdfLecture2_IntroductionToPHP_Spring2023.pdf
Lecture2_IntroductionToPHP_Spring2023.pdf
 
Php basic for vit university
Php basic for vit universityPhp basic for vit university
Php basic for vit university
 
php basics
php basicsphp basics
php basics
 
Php
PhpPhp
Php
 
php app development 1
php app development 1php app development 1
php app development 1
 
FYBSC IT Web Programming Unit IV PHP and MySQL
FYBSC IT Web Programming Unit IV  PHP and MySQLFYBSC IT Web Programming Unit IV  PHP and MySQL
FYBSC IT Web Programming Unit IV PHP and MySQL
 

Dernier

The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 

Dernier (20)

The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 

PHP & MySQL Guide for Dynamic Websites

  • 1. PHP & MySQLPHP & MySQL WebsolesTraining MaterialWebsolesTraining Material www.websoles.comwww.websoles.com
  • 2. What is PHP Used For? PHP is a general-purpose server-side scripting language originally designed for web development to produce dynamic web pages PHP can interact with MySQL databases
  • 3. What is PHP?What is PHP? PHP == ‘Hypertext Preprocessor’ Open-source, server-side scripting language Used to generate dynamic web-pages PHP scripts reside between reserved PHP tags This allows the programmer to embed PHP scripts within HTML pages
  • 4. What is PHP (cont’d)What is PHP (cont’d)Interpreted language, scripts are parsed at run-time rather than compiled beforehand Executed on the server-side Source-code not visible by client ‘View Source’ in browsers does not display the PHP code Various built-in functions allow for fast development Compatible with many popular databases
  • 5. What does PHP code look like?What does PHP code look like? Structurally similar to C/C++ Supports procedural and object-oriented paradigm (to some degree) All PHP statements end with a semi-colon Each PHP script must be enclosed in the reserved PHP tag <?php … ?>
  • 6. Comments in PHPComments in PHP Standard C, C++, and shell comment symbols // C++ and Java-style comment # Shell-style comments /* C-style comments These can span multiple lines */
  • 7. Variables in PHPVariables in PHP PHP variables must begin with a “$” sign Case-sensitive ($Foo != $foo != $fOo) Global and locally-scoped variables Global variables can be used anywhere Local variables restricted to a function or class Certain variable names reserved by PHP Form variables ($_POST, $_GET) Server variables ($_SERVER) Etc.
  • 8. Variable usageVariable usage <?php $foo = 25; // Numerical variable $bar = “Hello”; // String variable $foo = ($foo * 7); // Multiplies foo by 7 $bar = ($bar * 7); // Invalid expression ?>
  • 9. EchoEcho The PHP command ‘echo’ is used to output the parameters passed to it The typical usage for this is to send data to the client’s web-browser Syntax void echo (string arg1 [, string argn...]) In practice, arguments are not passed in parentheses since echo is a language construct rather than an actual function
  • 10. Echo exampleEcho example  Notice how echo ‘5x5=$foo’ outputs $foo rather than replacing it with 25  Strings in single quotes (‘ ’) are not interpreted or evaluated by PHP  This is true for both variables and character escape-sequences (such as “n” or “”) <?php $foo = 25; // Numerical variable $bar = “Hello”; // String variable echo $bar; // Outputs Hello echo $foo,$bar; // Outputs 25Hello echo “5x5=”,$foo; // Outputs 5x5=25 echo “5x5=$foo”; // Outputs 5x5=25 echo ‘5x5=$foo’; // Outputs 5x5=$foo ?>
  • 11. Arithmetic OperationsArithmetic Operations $a - $b // subtraction $a * $b // multiplication $a / $b // division $a += 5 // $a = $a+5 Also works for *= and /= <?php $a=15; $b=30; $total=$a+$b; Print $total; Print “<p><h1>$total</h1>”; // total is 45 ?>
  • 12. ConcatenationConcatenation Use a period to join strings into one. <?php $string1=“Hello”; $string2=“PHP”; $string3=$string1 . “ ” . $string2; Print $string3; ?> Hello PHP
  • 13. Escaping the CharacterEscaping the Character If the string has a set of double quotation marks that must remain visible, use the [backslash] before the quotation marks to ignore and display them. <?php $heading=“”Computer Science””; Print $heading; ?> “Computer Science”
  • 14. PHP Control StructuresPHP Control Structures  Control Structures: Are the structures within a language that allow us to control the flow of execution through a program or script.  Grouped into conditional (branching) structures (e.g. if/else) and repetition structures (e.g. while loops).  Example if/else if/else statement: if ($foo == 0) { echo ‘The variable foo is equal to 0’; } else if (($foo > 0) && ($foo <= 5)) { echo ‘The variable foo is between 1 and 5’; } else { echo ‘The variable foo is equal to ‘.$foo; }
  • 15. If ... Else...If ... Else... If (condition) { Statements; } Else { Statement; } <?php If($user==“John”) { Print “Hello John.”; } Else { Print “You are not John.”; } ?> No THEN in PHP
  • 16. While LoopsWhile Loops While (condition) { Statements; } <?php $count=0; While($count<3) { Print “hello PHP. ”; $count += 1; // $count = $count + 1; // or // $count++; ?> hello PHP. hello PHP. hello PHP.
  • 17. Date DisplayDate Display $datedisplay=date(“yyyy/m/d”); Print $datedisplay; # If the date is April 1st , 2009 # It would display as 2009/4/1 2009/4/1 $datedisplay=date(“l, F m, Y”); Print $datedisplay; # If the date is April 1st , 2009 # Wednesday, April 1, 2009 Wednesday, April 1, 2009
  • 18. Month, Day & Date FormatMonth, Day & Date Format SymbolsSymbols M Jan F January m 01 n 1 Day of Month d 01 Day of Month J 1 Day of Week l Monday Day of Week D Mon
  • 19. FunctionsFunctions Functions MUST be defined before then can be called Function headers are of the format Note that no return type is specified Unlike variables, function names are not case sensitive (foo(…) == Foo(…) == FoO(…)) function functionName($arg_1, $arg_2, …, $arg_n)
  • 20. Functions exampleFunctions example <?php // This is a function function foo($arg_1, $arg_2) { $arg_2 = $arg_1 * $arg_2; return $arg_2; } $result_1 = foo(12, 3); // Store the function echo $result_1; // Outputs 36 echo foo(12, 3); // Outputs 36 ?>
  • 21. Include FilesInclude FilesInclude “opendb.php”; Include “closedb.php”; This inserts files; the code in files will be inserted into current code. This will provide useful and protective means once you connect to a database, as well as for other repeated functions. Include (“footer.php”); The file footer.php might look like: <hr SIZE=11 NOSHADE WIDTH=“100%”> <i>Copyright © 2008-2010 KSU </i></font><br> <i>ALL RIGHTS RESERVED</i></font><br> <i>URL: http://www.kent.edu</i></font><br>
  • 22. PHP - FormsPHP - Forms •Access to the HTTP POST and GET data is simple in PHPAccess to the HTTP POST and GET data is simple in PHP •The global variables $_POST[] and $_GET[] contain theThe global variables $_POST[] and $_GET[] contain the request datarequest data <?php if ($_POST["submit"]) echo "<h2>You clicked Submit!</h2>"; else if ($_POST["cancel"]) echo "<h2>You clicked Cancel!</h2>"; ?> <form action="form.php" method="post"> <input type="submit" name="submit" value="Submit"> <input type="submit" name="cancel" value="Cancel"> </form> http://www.cs.kent.edu/~nruan/form.php
  • 23. WHY PHP – Sessions ?WHY PHP – Sessions ?Whenever you want to create aWhenever you want to create a websitewebsite that allows you to store and displaythat allows you to store and display information about a user, determine which user groups a person belongs to,information about a user, determine which user groups a person belongs to, utilize permissions on yourutilize permissions on your websitewebsite or you just want to do something cool onor you just want to do something cool on your site,your site, PHP's SessionsPHP's Sessions are vital toare vital to eacheach of these features.of these features. Cookies are about 30% unreliable right now and it's getting worse every day.Cookies are about 30% unreliable right now and it's getting worse every day. More and more web browsers are starting to come with security and privacyMore and more web browsers are starting to come with security and privacy settings and people browsing the net these days are starting to frown uponsettings and people browsing the net these days are starting to frown upon Cookies because they store information on their local computer that they doCookies because they store information on their local computer that they do not want stored there.not want stored there. PHP has a great set of functions that can achieve the same results ofPHP has a great set of functions that can achieve the same results of Cookies and more without storing information on the user's computer. PHPCookies and more without storing information on the user's computer. PHP Sessions store the information on the web server in a location that you choseSessions store the information on the web server in a location that you chose in special files. These files are connected to the user's web browser via thein special files. These files are connected to the user's web browser via the server and a special ID called a "Session ID". This is nearly 99% flawless inserver and a special ID called a "Session ID". This is nearly 99% flawless in operation and it is virtually invisible to the user.operation and it is virtually invisible to the user.
  • 24. PHP - SessionsPHP - Sessions •Sessions store their identifier in a cookie in the client’s browserSessions store their identifier in a cookie in the client’s browser •Every page that uses session data must be proceeded by theEvery page that uses session data must be proceeded by the session_start()session_start() functionfunction •Session variables are then set and retrieved by accessing the globalSession variables are then set and retrieved by accessing the global $_SESSION[]$_SESSION[] •Save it asSave it as session.phpsession.php <?php<?php session_start();session_start(); if (!$_SESSION["count"])if (!$_SESSION["count"]) $_SESSION["count"] = 0;$_SESSION["count"] = 0; if ($_GET["count"] == "yes")if ($_GET["count"] == "yes") $_SESSION["count"] = $_SESSION["count"] + 1;$_SESSION["count"] = $_SESSION["count"] + 1; echo "<h1>".$_SESSION["count"]."</h1>";echo "<h1>".$_SESSION["count"]."</h1>"; ?>?> <a href="session.php?count=yes">Click here to count</a><a href="session.php?count=yes">Click here to count</a> http://www.cs.kent.edu/~nruan/session.php
  • 25. Avoid Error PHP - SessionsAvoid Error PHP - Sessions PHP Example: <?php echo "Look at this nasty error below:<br />"; session_start(); ?> Error! PHP Example: <?php session_start(); echo "Look at this nasty error below:"; ?> Correct Warning: Cannot send session cookie - headers already sent by (output started at session_header_error/session_error.php:2) in session_header_error/session_error.php on line 3 Warning: Cannot send session cache limiter - headers already sent (output started at session_header_error/session_error.php:2) in session_header_error/session_error.php on line 3
  • 26. Destroy PHP - SessionsDestroy PHP - Sessions Destroying a Session why it is necessary to destroy a session when the session will get destroyed when the user closes their browser. Well, imagine that you had a session registered called "access_granted" and you were using that to determine if the user was logged into your site based upon a username and password. Anytime you have a login feature, to make the users feel better, you should have a logout feature as well. That's where this cool function called session_destroy() comes in handy. session_destroy() will completely demolish your session (no, the computer won't blow up or self destruct) but it just deletes the session files and clears any trace of that session. NOTE: If you are using the $_SESSION superglobal array, you must clear the array values first, then run session_destroy. Here's how we use session_destroy():
  • 27. Destroy PHP - SessionsDestroy PHP - Sessions <?php // start the session session_start(); header("Cache-control: private"); //IE 6 Fix $_SESSION = array(); session_destroy(); echo "<strong>Step 5 - Destroy This Session </strong><br />"; if($_SESSION['name']){     echo "The session is still active"; } else {     echo "Ok, the session is no longer active! <br />";     echo "<a href="page1.php"><< Go Back Step 1</a>"; } ?>
  • 28. PHP OverviewPHP Overview Easy learning Syntax Perl- and C-like syntax. Relatively easy to learn. Large function library Embedded directly into HTML Interpreted, no need to compile Open Source server-side scripting language designed specifically for the web.
  • 29. PHP Overview (cont.)PHP Overview (cont.) Conceived in 1994, now used on +10 million web sites. Outputs not only HTML but can output XML, images (JPG & PNG), PDF files and even Flash movies all generated on the fly. Can write these files to the file system. Supports a wide-range of databases (20+ODBC). PHP also has support for talking to other services using protocols such as LDAP, IMAP, SNMP, NNTP, POP3, HTTP.
  • 30.  Save as sample.php: <!– sample.php --> <html><body> <strong>Hello World!</strong><br /> <?php echo “<h2>Hello, World</h2>”; ?> <?php $myvar = "Hello World"; echo $myvar; ?> </body></html> First PHP scriptFirst PHP script http://www.cs.kent.edu/~nruan/sample.php
  • 31. Example – show data in theExample – show data in the tablestables Function: list all tables in your database. Users can select one of tables, and show all contents in this table. second.php showtable.php
  • 32. second.phpsecond.php <html><head><title>MySQL Table Viewer</title></head><body> <?php // change the value of $dbuser and $dbpass to your username and password $dbhost = 'hercules.cs.kent.edu:3306'; $dbuser = 'nruan'; $dbpass = ‘*****************’; $dbname = $dbuser; $table = 'account'; $conn = mysql_connect($dbhost, $dbuser, $dbpass); if (!$conn) { die('Could not connect: ' . mysql_error()); } if (!mysql_select_db($dbname)) die("Can't select database");
  • 33. second.php (cont.)second.php (cont.)$result = mysql_query("SHOW TABLES"); if (!$result) { die("Query to show fields from table failed"); } $num_row = mysql_num_rows($result); echo "<h1>Choose one table:<h1>"; echo "<form action="showtable.php" method="POST">"; echo "<select name="table" size="1" Font size="+2">"; for($i=0; $i<$num_row; $i++) { $tablename=mysql_fetch_row($result); echo "<option value="{$tablename[0]}" >{$tablename[0]}</option>"; } echo "</select>"; echo "<div><input type="submit" value="submit"></div>"; echo "</form>"; mysql_free_result($result); mysql_close($conn); ?> </body></html>
  • 34. showtable.phpshowtable.php<html><head> <title>MySQL Table Viewer</title> </head> <body> <?php $dbhost = 'hercules.cs.kent.edu:3306'; $dbuser = 'nruan'; $dbpass = ‘**********’; $dbname = 'nruan'; $table = $_POST[“table”]; $conn = mysql_connect($dbhost, $dbuser, $dbpass); if (!$conn) die('Could not connect: ' . mysql_error()); if (!mysql_select_db($dbname)) die("Can't select database"); $result = mysql_query("SELECT * FROM {$table}"); if (!$result) die("Query to show fields from table failed!" . mysql_error());
  • 35. showtable.php (cont.)showtable.php (cont.)$fields_num = mysql_num_fields($result); echo "<h1>Table: {$table}</h1>"; echo "<table border='1'><tr>"; // printing table headers for($i=0; $i<$fields_num; $i++) { $field = mysql_fetch_field($result); echo "<td><b>{$field->name}</b></td>"; } echo "</tr>n"; while($row = mysql_fetch_row($result)) { echo "<tr>"; // $row is array... foreach( .. ) puts every element // of $row to $cell variable foreach($row as $cell) echo "<td>$cell</td>"; echo "</tr>n"; } mysql_free_result($result); mysql_close($conn); ?> </body></html>
  • 36. Functions CoveredFunctions Covered mysql_connect() mysql_select_db() include() mysql_query() mysql_num_rows() mysql_fetch_array()mysql_close()
  • 37. History of PHPHistory of PHP PHP began in 1995 when Rasmus Lerdorf developed a Perl/CGI script toolset he called the Personal Home Page or PHP PHP 2 released 1997 (PHP now stands for Hypertex Processor). Lerdorf developed it further, using C instead PHP3 released in 1998 (50,000 users) PHP4 released in 2000 (3.6 million domains). Considered debut of functional language and including Perl parsing, with other major features PHP5.0.0 released July 13, 2004 (113 libraries>1,000 functions with extensive object-oriented programming) PHP5.0.5 released Sept. 6, 2005 for maintenance and bug fixes
  • 38. Recommended Texts forRecommended Texts for Learning PHPLearning PHP Larry Ullman’s books from the Visual Quickpro series PHP & MySQL for Dummies Beginning PHP 5 and MySQL: From Novice to Professional by W. Jason Gilmore (This is more advanced and dense than the others, but great to read once you’ve finished the easier books. One of the best definition/description of object oriented programming I’ve read)
  • 39. PHP ReferencesPHP References http://www.php.net <-- php home page http://www.phpbuilder.com/ http://www.devshed.com/ http://www.phpmyadmin.net/ http://www.hotscripts.com/PHP/ http://geocities.com/stuprojects/ChatroomDescription.htm http://www.academic.marist.edu/~kbhkj/chatroom/chatroom.htm http://www.aus-etrade.com/Scripts/php.php http://www.codeproject.com/asp/CDIChatSubmit.asp http://www.php.net/downloads <-- php download page http://www.php.net/manual/en/install.windows.php <-- php installation manual http://php.resourceindex.com/ <-- PHP resources like sample programs, text book references, etc. http://www.daniweb.com/techtalkforums/forum17.html  php forums