Jump to content

Need help with ftp please.


11Tami

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.