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 65
// Calculate session time
$session_time = ($current_time["sec"] -
$start_time["sec"]);
if($current_time["usec"] >
$start_time["usec"])
$session_time += ($current_time["usec"]
- $start_time["usec"])/1000000;
else
$session_time -= ($current_time["usec"]
- $start_time["usec"])/1000000;
error_reporting(0);
if(is_file($alarm_file))
{
handle_alarm($session,$alarm_file);
}
error_reporting(E_ALL);
}
if($session_time>=$time) error_log("Timed upload
complete",0);
if($failures>=(strlen($seq_sources)*2))
error_log("Too many consecutive failures",0);
}
}
else
{
error_log("Could not log in as ".$user." on
".$ftpserver,0);
}
ftp_quit($session);
}
else
{
error_log("Could not connect to ".$ftp_server.":".$port,0);
}
error_log("Cleaning up",0);
for($c=0;$c<(strlen($seq_sources));$c++)
{
//$command="bufferd -stop -buffername
//".$seq_buffer_prefix.substr($seq_sources,$c,1);
//system($command);
$command="bufferd -reset -buffername
".$seq_buffer_prefix.substr($seq_sources,$c,1);
system($command);
}
?>










