FTP Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationFTP Help

Closed Thread
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 13th, 2005, 03:42 PM
Mertle Mertle is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 13 Mertle User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 52 m 10 sec
Reputation Power: 0
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%">&nbsp;&nbsp;<b>Select Software Consultants Schedule:</b></td>
<td colspan=2>
<input type=file name=source_file size=20 > <br>
<br>
<td nowrap width="1%">&nbsp;&nbsp;<b>Select OnSite

Schedule:</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n

bsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td colspan=2>
<input type=file name=source_file2 size=20 > <br>
<br>
<td nowrap width="1%">&nbsp;&nbsp;<b>Select Installations

Schedule:</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td colspan=2>
<input type=file name=source_file3 size=20 > <br>
<br>
<td nowrap width="1%">&nbsp;&nbsp;<b>Select Clacton & Harwich Schedule:</b>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td colspan=2>
<input type=file name=source_file4 size=20 > <br>
<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;





</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);
?>

Reply With Quote
  #2  
Old January 13th, 2005, 04:08 PM
Mertle Mertle is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 13 Mertle User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 52 m 10 sec
Reputation Power: 0
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

Reply With Quote
  #3  
Old January 13th, 2005, 06:49 PM
Mertle Mertle is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 13 Mertle User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 52 m 10 sec
Reputation Power: 0
I Have moved this thread to PHP, as its not an ftp problem anymore and realised i posted it in the wrong format... DOH....

Reply With Quote
Closed Thread

Viewing: Dev Shed ForumsSystem AdministrationFTP Help > FTP stopped working


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT