User Guide

Appendix C - PHP3 Script Examples
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.9 May 2001 40
This script will upload specified image buffers via FTP and
the Ethernet interface, and also send a mail as specified.
(alarm_ftp_note_smtp_net.php3)
Edit your own parameters below this line.
<?
$buffer_prefix = "CAM"; // The prefix of the name of the
//buffer(s) started
$sources = "1"; // The index of the name(s) of
//the buffer(s) started
$imageformat = "fullsize"; // The format of the images
//specified to be taken according
//to the HTTP-API
$pre = 2; // Number of pre alarm images to
//be taken
$post = 2; // Number of post alarm images to
//be taken
$predelay = 1000; // Delay between pre images in
//milliseconds
$postdelay = 1000; // Delay between post images in
//milliseconds
$ftp_server = "10.13.9.130"; // The server to upload to
$port = "21"; // The port to connect to
$user = "user"; // The user to login as
$pass = "pass"; // The pass to use for the user
$passive_mode = "no"; // Choose passive mode on ("yes")
//or off ("no"). (See
//documentation on FTP protocol)
$destination = "upload/ae2400"; // The path to append to all
//uploads. This path must exist
//on the server prior to upload.
$smtp_server = "193.13.178.2"; // The server to use as mail
//server
$subject = "'Alarm trigged'"; // The subject to use in the mail
$from = "someone@somewhere.com"; // The specified sender
$reply = " someone@somewhere.com "; // The specified receiver of
//replies
$cc = " someone@somewhere.com "; // The specified receiver of a
//copy of this mail
$body = "/tmp/var/log/messages"; // The body to insert into the
//mail. Note that this must be
//specified and point to valid
//file
$to = " someone@somewhere.com "; // The specified recipient