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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.