Introduction to PHP.
Overview of PHP.
-
PHP is a server-side HTML-embedded script language
-
An alternative to:
-
CGI
-
APS (ms Active Server Pages)
-
JSP (sun's JavaServer Pages)
-
ColdFusion (Allaire's)
-
PHP has similarities with JavaScript
-
When a browser finds JavaScript in an HTML document
-
The browser calls the JavaScript interpreter to execute the script
-
When a browser request a document that includes a PHP script
-
The server providing the document calls the PHP processor
-
A document is recognized as including PHP script if its extension is:
.php, .php3, .phtml
-
The PHP preprocessor modes of operation:
-
Copy mode
-
HTML code in the input file ==> copies it to the output file
Which may include client-side scripts
-
Interpreter Mode
-
PHP script in the input file ==> interprets it and sends any output to the output file
The output form the PHP script must be HTML which may have embedded client-side scripts
-
Syntax and semantics of PHP closely related to JavaScript and Perl
-
PHP uses dynamic typing
Variables take on the type of the value it is being assigned
-
PHP arrays are a merge of the arrays of C/Java and the hashes of Perl
There is a large collection of functions for creating and manipulating PHP's arrays
-
Many predefined functions available to interface with other systems such as mail and database systems
-
The official Web site for PHP is: http://www.php.net
| Origins and Uses of PHP |
| Overview of PHP |
| General Syntactic Characteristics |
| Primitives, Operations, and Expressions |
| Output |
| Control Statements |
| Arrays |
| Functions |
| Pattern Matching |
| Form Handling |
| Files |
| Cookies |
| Session Tracking |