System information

An Introduction to PHP3
Axis Communications AB provides NO 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 1.02 October 2002 21
4.1.1 alert.lib
This script implements a function that connects to a host and leaves a message. This function
requires an application that can handle the alert to be running on the contacted host.
function alert($host,$protocol,$port,$message)
{
...
}
Parameter Description
$host
(not null) The host-name or address to send the alert to.
$protocol
Specify the protocol (0 = TCP, 1 = UDP). Default is 0.
$port
The port to connect to. Default is 15.
$message
the message to be sent (ASCII).
The timeout for a connection-attempt is 60 seconds. On error, the function returns 1 (connection
failed), 2 (a parameter was missing) or $SOCK_CONNECT_FAILED. If the connection fails, this is
logged in the syslog.
4.1.2 ftp.lib
This function has encapsulated the built-in PHP3-functions for FTP.
function
ftp($host,$user,$pass,$time,$delay,$source,$destination,$suffix,$count
ermax,$startcount,$port,$passive_mode)
{
...
}
Parameter Description
$host
(not null) FTP Host name.
$user
(not null) User name.
$password
(not null) Password.
$time
Transfer period in seconds (time < 0 is infinite (i.e. never leave this
function), time >= 0 is once).
$delay
Delay between transfers in milliseconds.
$source
(not null) Source specification. If the source file is a directory, the
command will try to transfer each file in this directory. When transferring
a whole directory, time and delay are ignored.
$destination
(not null) Destination specification.
$suffix
Defines the type of stamp to be added to the filename.
Valid options are: default, date, sequence and sequence_max.
$countermax
Defines the suffix maximum index.
Only applies when $suffix = "sequence".
$startcount
Defines start value for the suffix index.
Only applies when $suffix = ("sequence"|"sequence_max").
$port
Port on the FTP-server to connect to.