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 60
There is no need to edit anything below the line.
error_reporting(0);
unlink($alarm_file);
error_reporting(E_ALL);
for($c=0;$c<(strlen($alarm_sources));$c++)
{ // Stop the alarm buffers
$command="bufferd -stop -buffername
".$alarm_buffer_prefix.substr($alarm_sources,$c,1);
system($command);
}
// Send the mail
$command = "smtpclient";
$command .=" -S ".$smtp_server;
$command .=" -s ".$subject;
$command .=" -f ".$from;
$command .=" -r ".$reply;
$command .=" -c ".$cc;
$command .=" -b ".$body;
$command .=" ".$to;
exec($command);
for($b=0;$b<(strlen($alarm_sources));$b++)
{ // Wait for the buffers to
//stop, as indicated by an
//existing status file in
//the buffer directories
$status_file =
"/tmp/".$alarm_buffer_prefix.substr($alarm_sources,$b,1)."/statu
s";
error_reporting(0);
while(!is_file($status_file))
{
sleep(($predelay+$postdelay)/1000);
}
error_reporting(E_ALL);
unlink($status_file);
}
if($session)
{ // Connection is
//established
for($i=0;$i < (strlen($alarm_sources));$i++)
{ // For each source
//specified
$directory="/tmp/".$alarm_buffer_prefix.substr($alarm_sour
ces,$i,1);
$buffer_handle = opendir($directory);










