|
|
|
| |||||||||
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
FTP stopped working
(not sure if this is an FTP problem or PHP sorry in advance if its in the wrong section)
Hi, I have been using a script to upload schedules to my website, it was all working well, then about 2 days ago just stopped... I really cant see anything wrong with the script, but was hoping the experts out there may see something wrong... (Sorry about the horrible coding though) The copy of files works with no problems, so i know ftp access is working.. its just the upload of the main files passed from the html page that have stopped.. Thanks for any help you can give.. ---------------html upload form -------------- <html> <body marginwidth=4 marginheight=4 topmargin=4 leftmargin=4 bgcolor=white vlink="#0000ff" link="#0000ff"> <form name="Attachments" method=POST action="sendit.php" enctype="multipart/form-data"> <input type=hidden name=box value=""> <tr> <td nowrap width="1%"> <b>Select Software Consultants Schedule:</b></td> <td colspan=2> <input type=file name=source_file size=20 > <br> <br> <td nowrap width="1%"> <b>Select OnSite Schedule:</b> &n bsp; </td> <td colspan=2> <input type=file name=source_file2 size=20 > <br> <br> <td nowrap width="1%"> <b>Select Installations Schedule:</b> </td> <td colspan=2> <input type=file name=source_file3 size=20 > <br> <br> <td nowrap width="1%"> <b>Select Clacton & Harwich Schedule:</b> </td> <td colspan=2> <input type=file name=source_file4 size=20 > <br> <br> </td> </tr> <input type=submit name=btnSubmit value="Upload" size=20 style="border: 1px solid #0000FF"></form> </body> </html> -------------sendit.php-------------------- <?php $ftp_server='ftp.domain.co.uk';//serverip $conn_id = ftp_connect($ftp_server); // login with username and password $user="username"; $passwd="password"; $login_result = ftp_login($conn_id, $user, $passwd); // check connection if ((!$conn_id) || (!$login_result)) { echo "FTP connection has failed!"; echo "Attempted to connect to $ftp_server as user $ftp_user_name"; die; } else { echo '<br><img src="/company/schedules/check.jpg"><br>'; } ftp_chdir($conn_id, "schedules"); $destination_file="sc2005.xls"; $destination_file2="os2005.xls"; $destination_file3="in2005.xls"; $destination_file4="ch2005.xls"; $statuscurrent = '/public_html/company/schedules/current.gif'; $statusupdated = '/public_html/company/schedules/updated.gif'; $scstatus = '/public_html/company/schedules/scupdated.gif'; $instatus = '/public_html/company/schedules/inupdated.gif'; $osstatus = '/public_html/company/schedules/osupdated.gif'; $chstatus = '/public_html/company/schedules/chupdated.gif'; $yesuploaded = '/public_html/company/schedules/new.gif'; $yesuploaded2 = '/public_html/company/schedules/show.jpg'; $setstatusnew = '/public_html/company/schedules/newschedules.gif'; $setstatusnew2 = '/public_html/company/schedules/newschedulesavailable.jpg'; $checkforupdates = '0'; echo ("<br>"); echo ("<br>"); // upload Software Consultant Schedule $upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY); // check upload status of Software Consultant Schedule if (!$upload) { echo '<img src="/company/question.gif">'; echo " No Software Consultant Schedule selected to Upload!<br>"; copy($statuscurrent, $scstatus); echo " Software Consultants Schedule status set to Current!<br><br>"; } else { echo '<img src="/company/tick.gif">'; echo " Succesfully Uploaded Software Consultants Schedule to $ftp_server<br>"; copy($statusupdated, $scstatus); echo " Software Consultants Schedule status set to Updated! "; echo '<img src="/company/schedules/updated.gif"><br><br>'; $checkforupdates = ($checkforupdates + 1); } // upload OnSite Schedule $upload = ftp_put($conn_id, $destination_file2, $source_file2, FTP_BINARY); // check upload status of OnSite Schedule if (!$upload) { echo '<img src="/company/question.gif">'; echo " No OnSite Schedule selected to Upload!<br>"; copy($statuscurrent, $osstatus); echo " OnSite Schedule status set to Current!<br><br>"; } else { echo '<img src="/company/tick.gif">'; echo " Succesfully Uploaded OnSite Schedule to $ftp_server<br>"; copy($statusupdated, $osstatus); echo " On Site Schedule status set to Updated! "; echo '<img src="/company/schedules/updated.gif"><br><br>'; $checkforupdates = ($checkforupdates + 1); } // upload Installations Schedule $upload = ftp_put($conn_id, $destination_file3, $source_file3, FTP_BINARY); // check upload status of Installations Schedule if (!$upload) { echo '<img src="/company/question.gif">'; echo " No Installations Schedule selected to Upload!<br>"; copy($statuscurrent, $instatus); echo " Installations Schedule status set to Current!<br><br>"; } else { echo '<img src="/company/tick.gif">'; echo " Succesfully Uploaded Installations Schedule to $ftp_server<br>"; copy($statusupdated, $instatus); echo " Installations Schedule status set to Updated! "; echo '<img src="/company/schedules/updated.gif"><br><br>'; $checkforupdates = ($checkforupdates + 1); } // upload Clacton & Harwich Schedule $upload = ftp_put($conn_id, $destination_file4, $source_file4, FTP_BINARY); // check upload status of Clacton & Harwich Schedule if (!$upload) { echo '<img src="/company/question.gif">'; echo " No Clacton & Harwich Schedule to Upload!<br>"; copy($statuscurrent, $chstatus); echo " Clacton & Harwich Schedule status set to Current!<br><br>"; } else { echo '<img src="/company/tick.gif">'; echo " Succesfully Uploaded Clacton & Harwich Schedule to $ftp_server<br>"; copy($statusupdated, $chstatus); echo " Clacton & Harwich Schedule status set to Updated! "; echo '<img src="/company/schedules/updated.gif"><br><br>'; $checkforupdates = ($checkforupdates + 1); } // Check to see if any files have been uploaded and change main site if ($checkforupdates <> '0') { copy($yesuploaded, $setstatusnew); copy($yesuploaded2, $setstatusnew2); } else { copy($statuscurrent, $setstatusnew); copy($statuscurrent, $setstatusnew2); } // close the FTP stream ftp_close($conn_id); ?> |
|
#2
|
|||
|
|||
|
I have just got a reply from my Hosting company, saying they have disabled "register_globals"
Iam still very new to php and am now very confused, i am not sure how to get around this. Thanks again for any help you all can give Mert |
|
#3
|
|||
|
|||
|
I Have moved this thread to PHP, as its not an ftp problem anymore
and realised i posted it in the wrong format... DOH.... |
| Viewing: Dev Shed Forums > System Administration > FTP Help > FTP stopped working |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|