i mean when i ftp some host with php sripts,

i could be running a long time, i don't want it just like that,

i wish the php script will stop after 5 seconds,

and then to excute my other function in the same php.

such as the following:

if($the_time_limit>300){
    orther_function();
}else{
    continue_ftp();
}

how could i do?

    You would use

    set_time_limit(int);
    

    That would act like the time out var in the php.ini file. You can set it to any time in seconds you want.

      You can use these FTP functions and keep testing a timer while up/downloading files via ftp.

      ftp_nb_continue -- Continues retrieving/sending a file (non-blocking)
      ftp_nb_fget -- Retrieves a file from the FTP server and writes it to an open file (non-blocking)
      ftp_nb_fput -- Stores a file from an open file to the FTP server (non-blocking)
      ftp_nb_get -- Retrieves a file from the FTP server and writes it to a local file (non-blocking)
      ftp_nb_put -- Stores a file on the FTP server (non-blocking)

      HalfaBee

        Write a Reply...