PHP (PHP: Hypertext Preprocessor) is an HTML embedded scripting language. Much of
its syntax is borrowed from C, Java and Perl. Like Perl, it has no strong data typing.
If $a = 5 (the ASCII character, not a number) and $b = 3 ,
$a+$b will return 8,
$a*$b will return 15 and
$a.$b will return 53
A PHP file looks like a normal HTML file except for everything between the
?> tags. Everything here is executed and evaluated by the PHP engine before being sent
out to a browser window. Being server side, PHP code is completely invisible to the end
user. A PHP file might look as follows:
Today`s
date
is:
$today
=
date( F
jS,
Y );
echo $today. . ;
?>
All that will appear in the browser window when the file is called will be: Today`s date
is: April 28
th
, 2004. and if one decides to view the source of the page from the browser,
all that can be seen is:
Today`s date is:
April 28
th
, 2004.
A PHP script can do many more things than just print the date. Given the appropriate
permissions, it can read in HTML forms via HTTP POST or GET, send and receive
email, read, write and execute files on the server, handle file uploads from client
13