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 25
$passive_mode="on";
shoot();
$res = ftp($host, $user, $pass, $time, $delay, $source, $destination,
$suffix, $countermax, $startcount, $port, $passive_mode);
if($res == 1)
{
log("upload script - Could not connect to host");
}
else if($res == 2)
{
log("upload script - Could not log on to host");
}
else if($res == 3)
{
log("upload script - Could not put the file");
}
else if($res == 4)
{
log("upload script - something wrong with parameters");
}
else if($res == 5)
{
log("upload script - could not turn passive mode on/off");
}
?>
The second example depicts how to use the mail function, and is the script mentioned as
mail_syslog.php in the utask example:
<?php
include "/usr/php/mail.lib";
include "/usr/php/log.lib";
$subject="Todays messages";
$from="root@camera.domain";
$reply="";
$to="cam-admin@host.domain";
$copy="";
$body="/var/log/messages";
$attach="";
$res = mail($subject, $from, $reply, $to, $copy, $body, $attach);
if($res == 1)
{
log("mail script - Could not send mail:no sender\n");
}
else if($res == 2)
{
log("mail script - Could not send mail:no recipient\n");
}
?>