Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while($row = mysqli_fetch_array($rst))
- {
- //creating excel file here
- $passwordFTP = "password";
- $userFTP = "user";
- $hostFTP = "host";
- $i = 0;$test = 0;
- while($i < 3 && $test == 0)
- {
- $i++;
- try
- {
- $conn_id = ftp_connect($hostFTP);
- $login_result = ftp_login($conn_id, $userFTP, $passwordFTP);
- // turn passive mode on
- ftp_pasv($conn_id, true);
- if(ftp_put($conn_id, $output_filename, $path.$output_filename, FTP_BINARY))
- {
- $log = new Logs("listes.log", "Uploaded $output_filename");
- $test = 1;
- }
- else
- {
- $log = new Logs("listes.log", "($i)FAIL Uploading $output_filename");
- }
- ftp_close($conn_id);
- }
- catch (Exception $e)
- {
- $log = new Logs("listes.log", "($i)There was a problem while uploading $output_filename");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement