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
if(!ftp_put($session, $dest,
$source_file, FTP_BINARY))
{
$failures++;
error_log("Could not upload file
".$source_file." as ".$dest." on
".$ftp_server,0);
}
else
{
$failures=0;
unlink($source_file);
}
error_reporting(E_ALL);
}
else
{
error_reporting(E_ALL);
$failures++;
error_log("No such file:
".$source_file,0);
}
$current_time = gettimeofday();
$ellapsed = ($current_time["sec"] -
$loop_start["sec"]) * 1000000;
if($current_time["usec"] >
$loop_start["usec"])
$ellapsed += $current_time["usec"] -
$loop_start["usec"];
else
$ellapsed -= $current_time["usec"] -
$loop_start["usec"];
$wait = ($delay * 1000) /
strlen($seq_sources);
error_reporting(0);
if(is_file($alarm_file))
{
handle_alarm($session,$alarm_file);
}
error_reporting(E_ALL);
if($ellapsed < $wait)
usleep($wait - $ellapsed);
}
// Upload the source file
// If successful upload,
//remove the uploaded file
//indicating capture of a
//new image
// Wait if needed (in order
//to follow the delay
//specified and spread the
//traffic)
64
Need help?
Do you have a question about the 2400 - PHP3 GUIDE and is the answer not in the manual?
Questions and answers