User Guide

PHP3 Guide
Axis Communications AB does not provide support for application development of any kind. The
information here is provided "as is", and there is no guarantee that any of the examples shown
will work in your particular application.
Revision 0.91 June 2001 4
1.1 What is PHP
PHP (officially "PHP: Hypertext Preprocessor") is a server-side HTML-embedded
scripting language.
Simple answer, but what does that mean? An example:
Example 1-1. An introductory example
1
2 <html>
3 <head>
4 <title>Example</title>
5 </head>
6 <body>
7 <?PHP echo "Hi, I'm a PHP script!"; ?>
8 </body>
9 </html>
10
Notice how this is different from a CGI script written in other languages like Perl or C
-- instead of writing a program with lots of commands to output HTML, you write an
HTML script with some embedded code to do something (in this case, output some
text). The PHP code is enclosed in special start and end tags that allow you to jump
into and out of PHP mode.
What distinguishes PHP from something like client-side JavaScript is that the code is
executed on the server. If you were to have a script similar to the above on your
server, the client would receive the results of running that script, with no way of
determining what the underlying code may be. You can even configure your web
server to process all your HTML files with PHP, and then there's really no way that
users can tell what you have up your sleeve.
A lot of information about PHP can be found on the Internet:
http://www.PHP.net