Appendix C - PHP3 Script Examples
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++)
{
$command="bufferd -stop -buffername
".$alarm_buffer_prefix.substr($alarm_sources,$c,1);
system($command);
}
$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++)
{
$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)
{
for($i=0;$i < (strlen($alarm_sources));$i++)
{
$directory="/tmp/".$alarm_buffer_prefix.substr($alarm_sour
ces,$i,1);
$buffer_handle = opendir($directory);
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
// Stop the alarm buffers
// Send the mail
// Wait for the buffers to
//stop, as indicated by an
//existing status file in
//the buffer directories
// Connection is
//established
// For each source
//specified
60
Need help?
Do you have a question about the 2400 - PHP3 GUIDE and is the answer not in the manual?
Questions and answers