SlideShare a Scribd company logo
Forms, Functions etc.
Objects and Classes Functions Global Arrays Passing Variables
An object is a self-contained set of related variables and functions Objects are defined using the  class  keyword A  class  is the template for an object Variables contained within a class are called  class variables Class variables may have different scopes  public :  May be accessed directly private :  May only be accessed within the class static :  Only initialised once protected , global etc.
Class variables are referenced from outside the class using the  ->  $myClass->var = 4 Class variables are referenced from inside the class using  $this-> $this->var = 4 $this  must be used for  private  variables
You should have a constructor function which is called to create an instance of the class (an object) public function __construct([any arguments]){}
<?php class  student{ public $sID; //Show the id to everyone private $sName; //Limit the name public function  __construct ($name, $id)  { $this->$sID = $id; $this->sName = $sName; } public function printStudent() { echo “Student ID: $this->sID <br /> Student Name: $this->sName”;} } $ student1  = new  student(‘1234’, ‘Peter’) ; $ student1 -> printStudent (); ?>
Functions are a self-contained set of expressions and variables They are used to make a set of procedures repeatable function funcName($arg1, $arg2 [=default value]) A function can take arguments These arguments can have default values Values which are assumed if no value is provided
<?php function repeat($fname,$num=10) { echo &quot;<ol>&quot;; for ($i = 1; $i <= $num; $i++)  echo &quot;<li> $fname </li>&quot;; echo &quot;</ol>&quot;; } echo &quot;My name is &quot;; repeat(&quot;Kai Jim&quot;,5); echo &quot;My name is &quot;; repeat(”Jim Kai&quot;); ?>
<?php function buildRows($array){ $rows = '<tr><td bgcolor=&quot;blue&quot;>’ .implode('</td></tr><tr><td bgcolor=&quot;yellow&quot;>', $array)  .'</td></tr>'; return $rows; } function buildTable($rows){ $table = &quot;<table cellpadding='3’ border='2'> $rows </table>&quot;; return $table; } $myarray = array('php tutorial','mysql tutorial','apache tutorial','java tutorial','xml tutorial'); $rows = buildRows($myarray); $table = buildTable($rows); echo $table; ?> Implode(glue, $array):  Used to join array elements with a string
PHP creates 6 global arrays that contain EGPCS (Environment, Get, Post, Cookies and Server) information and File information PHP also creates an array called  $_REQUEST[]  that contains the unsafe variables. It’s content is dependant on configuration, but normally it contians the $_GET[], $_POST[] and $_COOKIES[] array variables amalgomated into one array.
$_SERVER  –  Information about the server session and the HTTP connection with the client. e.g.  $_SERVER[‘ HTTPS ’] : Is a secure connection being used $_POST[]  –  All variables received as an inline posted data set, normally through using the POST method in an HTML form. e .g. $_POST[‘username’] $_GET[]  – The values of any variables sent via the URL e .g. $_GET[‘username’]
$ _FILES  –  References to all files received, most commonly from HTML forms, using the POST method. $_ENV[]  – Contains the values of any environment variables, such as the browser version e .g.  $_ENV[‘HTTP_USER_AGENT’] $_COOKIES  – Contains any cookies submitted as name value pairs $_SESSION  – If PHP is being used for session management, this array is to store any session variables that need to be stored on the server between calls from the client.
$GLOBALS  –  Contains all the variables that are of global scope G lobal scope is a variable which is defined outside of any particular function They may also be referenced using the  global  keyword G lobal variables take precedence over locally defined variables
$a = 40; f unction add(){ $a = 30; $b = 20; global $a; return $a + $b; } echo “Going to add. Answer to 30+20 = ”.add();   $GLOBALS[] and  global  may both be used to access global variables $GLOBALS[] requires you assign the variable to a local variable Same as: $a = $GLOBALS[‘a’]
Where does the information which is submitted in a form go? <html>  <body> <form action=&quot;welcome.php&quot; method=&quot;post&quot;>  Name: <input type=&quot;text&quot; name=&quot;name&quot; />  Age: <input type=&quot;text&quot; name=&quot;age&quot; />  <input type=&quot;submit&quot; />  </form> </body> </html> The information goes to the location specified by  action=“”
The method used is post, so all variables sent are in the $_POST[] array <html>  <body> Welcome <?php echo $_POST[&quot;name&quot;]; ?>.<br />  You are <?php echo $_POST[&quot;age&quot;]; ?> years old. </body>  </html>  The output will be Welcome  James . You are  10  years old.
PHP creates a variable called within the SERVER global array called  $_SERVER[‘PHP_SELF’]  that contains the name of the current script/page (relative to the doc root) This is useful in creating forms This allows one page to handle all the form creation and handling May also make use of the  isset()  built-in PHP function Checks to see if a variable has been assigned a value
<?php if (!$_POST[&quot;surname&quot;] or !$_POST[&quot;address&quot;]){ ?>  <form method=&quot;post&quot; action=&quot;<?php echo $_SERVER['PHP_SELF'];?>&quot;> <p>Your surname: <input type=&quot;text&quot; name=&quot;surname&quot;></p> <p>Your address: <input type=&quot;text&quot; name=&quot;address&quot;></p> <input button type=&quot;submit&quot; value= &quot;Please send me the brochure.&quot;> </form> <?php  }  else{  $sn = $_REQUEST['surname']; echo &quot;<p>Thank you, $sn.</p>&quot;; $addr = $_REQUEST['address']; echo &quot;<p> We will write to you at $addr .</p>&quot;; }  ?>
<?php if (!$_POST[&quot;surname&quot;] or !$_POST[&quot;address&quot;]){ ?>  <form method=&quot;post&quot; action=&quot;<?php echo $_SERVER['PHP_SELF'];?>&quot;> <p>Your surname: <input type=&quot;text&quot; name=&quot;surname&quot;></p> <p>Your address: <input type=&quot;text&quot; name=&quot;address&quot;></p> <input button type=&quot;submit&quot; value= &quot;Please send me the brochure.&quot;> </form> <?php  }  else{  $sn = $_REQUEST['surname']; echo &quot;<p>Thank you, $sn.</p>&quot;; $addr = $_REQUEST['address']; echo &quot;<p> We will write to you at $addr .</p>&quot;; }  ?>
<?php if (!$_POST[&quot;surname&quot;] or !$_POST[&quot;address&quot;]){ ?>  <form method=&quot;post&quot; action=&quot;<?php echo $_SERVER['PHP_SELF'];?>&quot;> <p>Your surname: <input type=&quot;text&quot; name=&quot;surname&quot;></p> <p>Your address: <input type=&quot;text&quot; name=&quot;address&quot;></p> <input button type=&quot;submit&quot; value= &quot;Please send me the brochure.&quot;> </form> <?php  }  else{  $sn = $_REQUEST['surname']; echo &quot;<p>Thank you, $sn.</p>&quot;; $addr = $_REQUEST['address']; echo &quot;<p> We will write to you at $addr .</p>&quot;; }  ?>
<?php if (!$_POST[&quot;surname&quot;] or !$_POST[&quot;address&quot;]){ ?>  <form method=&quot;post&quot; action=&quot;<?php echo $_SERVER['PHP_SELF'];?>&quot;> <p>Your surname: <input type=&quot;text&quot; name=&quot;surname&quot;></p> <p>Your address: <input type=&quot;text&quot; name=&quot;address&quot;></p> <input button type=&quot;submit&quot; value= &quot;Please send me the brochure.&quot;> </form> <?php  }  else{  $sn = $_REQUEST['surname']; echo &quot;<p>Thank you, $sn.</p>&quot;; $addr = $_REQUEST['address']; echo &quot;<p> We will write to you at $addr .</p>&quot;; }  ?>
<form method=&quot;post&quot; action=&quot;<?php echo $_SERVER['PHP_SELF'];?>&quot;> Select the programming languages you can use<br> <input name=&quot;language[]&quot; type=&quot;checkbox&quot; id=&quot;language[]&quot; value=&quot;C++&quot;>  C++ <br> <input name=&quot;language[]&quot; type=&quot;checkbox&quot; id=&quot;language[]&quot; value=&quot;Java&quot;> Java <br> <input name=&quot;language[]&quot; type=&quot;checkbox&quot; id=&quot;language[]&quot; value=&quot;PHP&quot;> PHP <br> <input name=&quot;language[]&quot; type=&quot;checkbox&quot; id=&quot;language[]&quot; value=&quot;ASP&quot;> ASP <br> <input name=&quot;language[]&quot; type=&quot;checkbox&quot; id=&quot;language[]&quot; value=&quot;Delphi&quot;> Delphi <br> <input  name=&quot;lang&quot; button type=&quot;submit&quot;  value=&quot;Send it!&quot;> </form> <?php if(isset($_POST['lang'])){ $language = $_POST['language']; $n = count($language); $i = 0; echo &quot;The languages you selected are &quot; . &quot;<ol>&quot;; while ($i < $n){ echo &quot;<li>$language[$i]</li> &quot;; $i++; } echo &quot;</ol>&quot;; } ?>
Steven M. Schafer (2005),  HTML, CSS, JavaScript, Perl, and PHP Programmer's Reference , Hungry Minds Inc,U.S.  Christopher Schmitt (2003), Designing CSS Web Pages, New Riders Larry Ullman (2005), PHP and Mysql for Dynamic Web Sites, Peachpitt Press The main site for all PHP information: http://php.net

More Related Content

KEY
Introduction to Perl Best Practices
PPT
LPW: Beginners Perl
PDF
2014 database - course 2 - php
PPTX
Php server variables
ODP
Advanced Perl Techniques
PPT
PDF
Php Tutorials for Beginners
PPTX
Php functions
Introduction to Perl Best Practices
LPW: Beginners Perl
2014 database - course 2 - php
Php server variables
Advanced Perl Techniques
Php Tutorials for Beginners
Php functions

What's hot (20)

PPT
Introduction To Php For Wit2009
ODP
Beginning Perl
ODP
Introduction to Perl - Day 2
PPT
PPTX
Php pattern matching
ODP
PHP Basic
PPT
PHP - Introduction to PHP
PPT
Php i basic chapter 3
PDF
Data Types In PHP
PPT
Introduction to php
PPT
Zend framework 05 - ajax, json and j query
PPT
Class 5 - PHP Strings
PPTX
Class 8 - Database Programming
PPTX
PHP PPT FILE
KEY
Apache Velocity 1.6
PDF
Lecture19-20
PPT
Oop php 5
PDF
Perl programming language
PDF
Perl 5.10 for People Who Aren't Totally Insane
PPT
Dealing with Legacy Perl Code - Peter Scott
Introduction To Php For Wit2009
Beginning Perl
Introduction to Perl - Day 2
Php pattern matching
PHP Basic
PHP - Introduction to PHP
Php i basic chapter 3
Data Types In PHP
Introduction to php
Zend framework 05 - ajax, json and j query
Class 5 - PHP Strings
Class 8 - Database Programming
PHP PPT FILE
Apache Velocity 1.6
Lecture19-20
Oop php 5
Perl programming language
Perl 5.10 for People Who Aren't Totally Insane
Dealing with Legacy Perl Code - Peter Scott
Ad

Viewers also liked (11)

PPT
PPTX
Online Marketing Workshop Slides V1 0
PPT
Terenure Digital Insights Social Technology Overview Case Studies
PPT
Social Media Case Studies Tallaght M50
PPT
Building A Site Terenure Centre Jan26th2010 V1 3
PPT
Social Media&Business Case Terenure Nov13th1.1
PPT
Griffith-SocialMediaPlatforms
PPTX
RPC-SYOB-OnlineMarketingSession
Online Marketing Workshop Slides V1 0
Terenure Digital Insights Social Technology Overview Case Studies
Social Media Case Studies Tallaght M50
Building A Site Terenure Centre Jan26th2010 V1 3
Social Media&Business Case Terenure Nov13th1.1
Griffith-SocialMediaPlatforms
RPC-SYOB-OnlineMarketingSession
Ad

Similar to Further Php (20)

ODP
Modern Web Development with Perl
ODP
Form Processing In Php
PPT
Php Crash Course
PPT
Php Basic Security
ODP
The Basics Of Page Creation
PPT
Web Scraping with PHP
PPT
Framework
PPT
Zend framework 04 - forms
ODP
HTML::FormHandler
PPT
JQuery Basics
PPT
course slides -- powerpoint
PPT
Php Reusing Code And Writing Functions
PPT
Introduction To Lamp
PPT
Php Calling Operators
ODP
Intro to #memtech PHP 2011-12-05
ODP
PHP 102: Out with the Bad, In with the Good
PPT
Drupal Lightning FAPI Jumpstart
PPT
PHP Unit Testing
Modern Web Development with Perl
Form Processing In Php
Php Crash Course
Php Basic Security
The Basics Of Page Creation
Web Scraping with PHP
Framework
Zend framework 04 - forms
HTML::FormHandler
JQuery Basics
course slides -- powerpoint
Php Reusing Code And Writing Functions
Introduction To Lamp
Php Calling Operators
Intro to #memtech PHP 2011-12-05
PHP 102: Out with the Bad, In with the Good
Drupal Lightning FAPI Jumpstart
PHP Unit Testing

More from Digital Insights - Digital Marketing Agency (20)

PPT
Diploma-GCD-ContentMarketing-Personas-Week2
PPT
DigitalInsights-DigitalMarketingStrategy&Planning
PPT
PPT
DBS-Week2-DigitalStrategySession
PPT
GCD-Measurement&Analytics-Week11
PPT
DBS-Week1-Introduction&OverviewDigitalMarketing
PPT
DCEB-DigitalStrategySession-Jan24th
PPTX
PPT
PPTX
Week12-DBS-ReviewAndPlanningSession
PPT
GCD-Week5-Facebook-LinkedIn-Ads
PPT
DBS-Week11-Measurement&Analyics
PPT
PPTX
DBS-Week10-EcommSites&SalesFunnells
PPT
GCD-Week5-SocialMediaPlatforms
PPT
DBS-Week3-B2C&B2B-ContentMarketing-Session
PPTX
DBS-Week9-Wordpress-Session
Diploma-GCD-ContentMarketing-Personas-Week2
DigitalInsights-DigitalMarketingStrategy&Planning
DBS-Week2-DigitalStrategySession
GCD-Measurement&Analytics-Week11
DBS-Week1-Introduction&OverviewDigitalMarketing
DCEB-DigitalStrategySession-Jan24th
Week12-DBS-ReviewAndPlanningSession
GCD-Week5-Facebook-LinkedIn-Ads
DBS-Week11-Measurement&Analyics
DBS-Week10-EcommSites&SalesFunnells
GCD-Week5-SocialMediaPlatforms
DBS-Week3-B2C&B2B-ContentMarketing-Session
DBS-Week9-Wordpress-Session

Recently uploaded (20)

PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
TLE Review Electricity (Electricity).pptx
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PPTX
A Presentation on Artificial Intelligence
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PPTX
Spectroscopy.pptx food analysis technology
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PPT
Teaching material agriculture food technology
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
1. Introduction to Computer Programming.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
NewMind AI Weekly Chronicles - August'25-Week II
gpt5_lecture_notes_comprehensive_20250812015547.pdf
TLE Review Electricity (Electricity).pptx
Group 1 Presentation -Planning and Decision Making .pptx
A Presentation on Artificial Intelligence
Diabetes mellitus diagnosis method based random forest with bat algorithm
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Spectroscopy.pptx food analysis technology
Network Security Unit 5.pdf for BCA BBA.
Heart disease approach using modified random forest and particle swarm optimi...
Teaching material agriculture food technology
A comparative study of natural language inference in Swahili using monolingua...
Advanced methodologies resolving dimensionality complications for autism neur...
1. Introduction to Computer Programming.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Unlocking AI with Model Context Protocol (MCP)
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
NewMind AI Weekly Chronicles - August'25-Week II

Further Php

  • 2. Objects and Classes Functions Global Arrays Passing Variables
  • 3. An object is a self-contained set of related variables and functions Objects are defined using the class keyword A class is the template for an object Variables contained within a class are called class variables Class variables may have different scopes public : May be accessed directly private : May only be accessed within the class static : Only initialised once protected , global etc.
  • 4. Class variables are referenced from outside the class using the -> $myClass->var = 4 Class variables are referenced from inside the class using $this-> $this->var = 4 $this must be used for private variables
  • 5. You should have a constructor function which is called to create an instance of the class (an object) public function __construct([any arguments]){}
  • 6. <?php class student{ public $sID; //Show the id to everyone private $sName; //Limit the name public function __construct ($name, $id) { $this->$sID = $id; $this->sName = $sName; } public function printStudent() { echo “Student ID: $this->sID <br /> Student Name: $this->sName”;} } $ student1 = new student(‘1234’, ‘Peter’) ; $ student1 -> printStudent (); ?>
  • 7. Functions are a self-contained set of expressions and variables They are used to make a set of procedures repeatable function funcName($arg1, $arg2 [=default value]) A function can take arguments These arguments can have default values Values which are assumed if no value is provided
  • 8. <?php function repeat($fname,$num=10) { echo &quot;<ol>&quot;; for ($i = 1; $i <= $num; $i++) echo &quot;<li> $fname </li>&quot;; echo &quot;</ol>&quot;; } echo &quot;My name is &quot;; repeat(&quot;Kai Jim&quot;,5); echo &quot;My name is &quot;; repeat(”Jim Kai&quot;); ?>
  • 9. <?php function buildRows($array){ $rows = '<tr><td bgcolor=&quot;blue&quot;>’ .implode('</td></tr><tr><td bgcolor=&quot;yellow&quot;>', $array) .'</td></tr>'; return $rows; } function buildTable($rows){ $table = &quot;<table cellpadding='3’ border='2'> $rows </table>&quot;; return $table; } $myarray = array('php tutorial','mysql tutorial','apache tutorial','java tutorial','xml tutorial'); $rows = buildRows($myarray); $table = buildTable($rows); echo $table; ?> Implode(glue, $array): Used to join array elements with a string
  • 10. PHP creates 6 global arrays that contain EGPCS (Environment, Get, Post, Cookies and Server) information and File information PHP also creates an array called $_REQUEST[] that contains the unsafe variables. It’s content is dependant on configuration, but normally it contians the $_GET[], $_POST[] and $_COOKIES[] array variables amalgomated into one array.
  • 11. $_SERVER – Information about the server session and the HTTP connection with the client. e.g. $_SERVER[‘ HTTPS ’] : Is a secure connection being used $_POST[] – All variables received as an inline posted data set, normally through using the POST method in an HTML form. e .g. $_POST[‘username’] $_GET[] – The values of any variables sent via the URL e .g. $_GET[‘username’]
  • 12. $ _FILES – References to all files received, most commonly from HTML forms, using the POST method. $_ENV[] – Contains the values of any environment variables, such as the browser version e .g. $_ENV[‘HTTP_USER_AGENT’] $_COOKIES – Contains any cookies submitted as name value pairs $_SESSION – If PHP is being used for session management, this array is to store any session variables that need to be stored on the server between calls from the client.
  • 13. $GLOBALS – Contains all the variables that are of global scope G lobal scope is a variable which is defined outside of any particular function They may also be referenced using the global keyword G lobal variables take precedence over locally defined variables
  • 14. $a = 40; f unction add(){ $a = 30; $b = 20; global $a; return $a + $b; } echo “Going to add. Answer to 30+20 = ”.add(); $GLOBALS[] and global may both be used to access global variables $GLOBALS[] requires you assign the variable to a local variable Same as: $a = $GLOBALS[‘a’]
  • 15. Where does the information which is submitted in a form go? <html> <body> <form action=&quot;welcome.php&quot; method=&quot;post&quot;> Name: <input type=&quot;text&quot; name=&quot;name&quot; /> Age: <input type=&quot;text&quot; name=&quot;age&quot; /> <input type=&quot;submit&quot; /> </form> </body> </html> The information goes to the location specified by action=“”
  • 16. The method used is post, so all variables sent are in the $_POST[] array <html> <body> Welcome <?php echo $_POST[&quot;name&quot;]; ?>.<br /> You are <?php echo $_POST[&quot;age&quot;]; ?> years old. </body> </html> The output will be Welcome James . You are 10 years old.
  • 17. PHP creates a variable called within the SERVER global array called $_SERVER[‘PHP_SELF’] that contains the name of the current script/page (relative to the doc root) This is useful in creating forms This allows one page to handle all the form creation and handling May also make use of the isset() built-in PHP function Checks to see if a variable has been assigned a value
  • 18. <?php if (!$_POST[&quot;surname&quot;] or !$_POST[&quot;address&quot;]){ ?> <form method=&quot;post&quot; action=&quot;<?php echo $_SERVER['PHP_SELF'];?>&quot;> <p>Your surname: <input type=&quot;text&quot; name=&quot;surname&quot;></p> <p>Your address: <input type=&quot;text&quot; name=&quot;address&quot;></p> <input button type=&quot;submit&quot; value= &quot;Please send me the brochure.&quot;> </form> <?php } else{ $sn = $_REQUEST['surname']; echo &quot;<p>Thank you, $sn.</p>&quot;; $addr = $_REQUEST['address']; echo &quot;<p> We will write to you at $addr .</p>&quot;; } ?>
  • 19. <?php if (!$_POST[&quot;surname&quot;] or !$_POST[&quot;address&quot;]){ ?> <form method=&quot;post&quot; action=&quot;<?php echo $_SERVER['PHP_SELF'];?>&quot;> <p>Your surname: <input type=&quot;text&quot; name=&quot;surname&quot;></p> <p>Your address: <input type=&quot;text&quot; name=&quot;address&quot;></p> <input button type=&quot;submit&quot; value= &quot;Please send me the brochure.&quot;> </form> <?php } else{ $sn = $_REQUEST['surname']; echo &quot;<p>Thank you, $sn.</p>&quot;; $addr = $_REQUEST['address']; echo &quot;<p> We will write to you at $addr .</p>&quot;; } ?>
  • 20. <?php if (!$_POST[&quot;surname&quot;] or !$_POST[&quot;address&quot;]){ ?> <form method=&quot;post&quot; action=&quot;<?php echo $_SERVER['PHP_SELF'];?>&quot;> <p>Your surname: <input type=&quot;text&quot; name=&quot;surname&quot;></p> <p>Your address: <input type=&quot;text&quot; name=&quot;address&quot;></p> <input button type=&quot;submit&quot; value= &quot;Please send me the brochure.&quot;> </form> <?php } else{ $sn = $_REQUEST['surname']; echo &quot;<p>Thank you, $sn.</p>&quot;; $addr = $_REQUEST['address']; echo &quot;<p> We will write to you at $addr .</p>&quot;; } ?>
  • 21. <?php if (!$_POST[&quot;surname&quot;] or !$_POST[&quot;address&quot;]){ ?> <form method=&quot;post&quot; action=&quot;<?php echo $_SERVER['PHP_SELF'];?>&quot;> <p>Your surname: <input type=&quot;text&quot; name=&quot;surname&quot;></p> <p>Your address: <input type=&quot;text&quot; name=&quot;address&quot;></p> <input button type=&quot;submit&quot; value= &quot;Please send me the brochure.&quot;> </form> <?php } else{ $sn = $_REQUEST['surname']; echo &quot;<p>Thank you, $sn.</p>&quot;; $addr = $_REQUEST['address']; echo &quot;<p> We will write to you at $addr .</p>&quot;; } ?>
  • 22. <form method=&quot;post&quot; action=&quot;<?php echo $_SERVER['PHP_SELF'];?>&quot;> Select the programming languages you can use<br> <input name=&quot;language[]&quot; type=&quot;checkbox&quot; id=&quot;language[]&quot; value=&quot;C++&quot;> C++ <br> <input name=&quot;language[]&quot; type=&quot;checkbox&quot; id=&quot;language[]&quot; value=&quot;Java&quot;> Java <br> <input name=&quot;language[]&quot; type=&quot;checkbox&quot; id=&quot;language[]&quot; value=&quot;PHP&quot;> PHP <br> <input name=&quot;language[]&quot; type=&quot;checkbox&quot; id=&quot;language[]&quot; value=&quot;ASP&quot;> ASP <br> <input name=&quot;language[]&quot; type=&quot;checkbox&quot; id=&quot;language[]&quot; value=&quot;Delphi&quot;> Delphi <br> <input name=&quot;lang&quot; button type=&quot;submit&quot; value=&quot;Send it!&quot;> </form> <?php if(isset($_POST['lang'])){ $language = $_POST['language']; $n = count($language); $i = 0; echo &quot;The languages you selected are &quot; . &quot;<ol>&quot;; while ($i < $n){ echo &quot;<li>$language[$i]</li> &quot;; $i++; } echo &quot;</ol>&quot;; } ?>
  • 23. Steven M. Schafer (2005), HTML, CSS, JavaScript, Perl, and PHP Programmer's Reference , Hungry Minds Inc,U.S. Christopher Schmitt (2003), Designing CSS Web Pages, New Riders Larry Ullman (2005), PHP and Mysql for Dynamic Web Sites, Peachpitt Press The main site for all PHP information: http://php.net