11Tami Posted April 20, 2007 Share Posted April 20, 2007 Hello, I'm trying to follow the example on W3 schools page found here: http://www.w3schools.com/php/func_ftp_fput.asp So I put my own web address under ftp_connect, then put my own admin name and password under ftp_login. Then I uploaded a text file called source.txt to the root with a tiny bit of text in it and uploaded target.txt to the root with no text in it. Then I tried to run the .php page with this code in it. <?php $source = fopen("source.txt","r");$conn = ftp_connect("ftp.myownwebsite.com") or die("Could not connect"); ftp_login($conn,"myownadminname","myownpassword");echo ftp_fput($conn,"target.txt",$source,FTP_ASCII);ftp_close($conn); ?> I just get an error saying it can't connect due to an error on line 4. Can someone please help? Thanks you very much. Link to comment https://forums.phpfreaks.com/topic/47849-need-help-with-ftp-please/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.