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 47
if($suffix == "date")
{
$tinfo = getdate(time());
$dest .= "_" . conv($tinfo["year"]);
$dest .= "-" . conv($tinfo["mon"]);
$dest .= "-" . conv($tinfo["mday"]);
$dest .= "_";
$dest .= conv($tinfo["hours"]);
$dest .= conv($tinfo["minutes"]);
$dest .= conv($tinfo["seconds"]);
}
else if($suffix == "sequence_max")
{
$dest .= "_" . strval($current_counter);
$inc++;
if($inc >= strlen($sources))
{
$current_counter++;
error_reporting(0);
if($fd = fopen("/tmp/counter","w"))
{
$buf =
fwrite($fd,strval($current_cou
nter));
fclose($fd);
}
error_reporting(E_ALL);
$inc = 0;
}
}
else if($suffix == "sequence")
{
if($current_counter > $counter_max)
{
$counter = 1;
}
$dest .= "_" . strval($current_counter);
$inc++;
if($inc >= $buffer_count)
{
$current_counter++;
error_reporting(0);
if($fd = fopen("/tmp/counter","w"))
{
$buf =
fwrite($fd,strval($current_cou
nter));
fclose($fd);
}
error_reporting(E_ALL);
$inc = 0;
}
}










