System information

An Introduction to PHP3
Axis Communications AB provides NO 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 1.02 October 2002 20
4 An Introduction to PHP3
PHP3 is a server-side HTML-embedded scripting language. A simple answer, but what does this
mean?
An example:
4.1 The PHP-libs
Included in the distributed firmware are a few PHP3-scripts that define functions intended to
help developers make the most of the camera/server's functionality. These scripts are located in
the directory
/usr/php. The files currently included are:
/usr/php/alert.lib
/usr/php/ftp.lib
/usr/php/log.lib
/usr/php/mail.lib
/usr/php/ppp.lib
In order to use these functions the files need to be included in the script using them. The
arguments used in the function calls also need to be defined/declared in the calling script.
Notice how this is different from a CGI script written in other languages such as 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 e.g. client-side JavaScript is that the code is executed on the
server. If you were to have a script similar to the one above on your server, the client would
receive the results of running that script, with no way of determining what the underlying code
looks like.
A lot of information about PHP is available on the Internet, for example, at http://www.php.net.
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