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 63
while( ($failures<(strlen($seq_sources)*2)) && (
($session_time<$time)||($time==-1) ))
{ // Upload images as long as
//not too many errors have
//occured and session time
//hasn't been exceeded
// Check if an alarm has trigged
error_reporting(0);
if(is_file($alarm_file))
{
handle_alarm($session,$alarm_file);
}
error_reporting(E_ALL);
$loop_start = gettimeofday();
$active_buffer++;
if($active_buffer==strlen($seq_sources))
{ // Loop through the indexes
//specified as sources
$active_buffer=0;
}
$source_file="/tmp/".$seq_buffer_prefix.substr
($seq_sources,$active_buffer,1)."/".$file_form
at.".jpg";
$tinfo = getdate(time());
// Build the destination
//path both for the script
//and on the server
error_reporting(0);
$dest =
$seq_destination.$seq_buffer_prefix.substr($se
q_sources,$active_buffer,1);
$dest .= "/" . conv($tinfo["year"]);
ftp_mkdir($session,$dest);
$dest .= "/" . conv($tinfo["mon"]);
ftp_mkdir($session,$dest);
$dest .= "/" . conv($tinfo["mday"]);
ftp_mkdir($session,$dest);
$dest .= "/" . conv($tinfo["hours"]);
ftp_mkdir($session,$dest);
$dest .= "/" . conv($tinfo["minutes"]);
ftp_mkdir($session,$dest);
$dest .= "/" . conv($tinfo["seconds"]);
$dest .= "_" .$loop_start["usec"].".jpg";
$structure_info=$tinfo;
if(is_file($source_file))
{ // If the source file is a
//present