ftp_connect problem

Discussion in 'PHP' started by apache164, Feb 25, 2011.

  1. #1
    I'm just starting to learn PHP and i have this code just to practice a little.

    <?php
    $user = user
    $pass = pass
    $conn = ftp_connect("practicefeedbackform.host22.com") or die("Could not connect");



    ftp_login($conn,"$user","$pass");

    ftp_mkdir($conn,"dir");

    ftp_rmdir($conn,"dir");

    ftp_close($conn);
    ?>

    $user and $pass are filled in with the correct username and password. the error is on line 3
     
    apache164, Feb 25, 2011 IP
  2. ThePHPMaster

    ThePHPMaster Well-Known Member

    Messages:
    737
    Likes Received:
    52
    Best Answers:
    33
    Trophy Points:
    150
    #2
    Is your FTP server using port 21 for listening to incoming connections?
     
    ThePHPMaster, Feb 25, 2011 IP
  3. apache164

    apache164 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    im not sure, although i can access it with filezilla. how would i check that? if it helps any im hosting the site on 000webhost
     
    apache164, Mar 19, 2011 IP
  4. Grit.

    Grit. Well-Known Member

    Messages:
    1,424
    Likes Received:
    22
    Best Answers:
    1
    Trophy Points:
    110
    #4
    can you tell us what error message you are recieving? this will help pinpoint where you issue lays, whether it's a PHP configuration stopping you, or an issue with your coding
     
    Grit., Mar 20, 2011 IP
  5. Irun

    Irun Active Member

    Messages:
    27
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    88
    #5
    try put to this one
    $user = "user";
    $pass = "pass";
    PHP:
     
    Irun, Mar 22, 2011 IP