Results 1 to 1 of 1

Thread: $else problems with an ftp login script

  1. #1
    Join Date
    Dec 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy $else problems with an ftp login script

    ok, so im making an ftp login script, and i have tried to put a mechinism in access.php to stop users from logging in with no username or password. The code looks ok, i dont get any php errors, but it just doesnt work, even when you type in a value in for the username and password fields, it still redirects back to index.htm, i only want it to do this when the user hasnt put any info into the user and password fields. Thanks

    index.htm
    HTML Code:
    <form action="access.php" method="POST">
    Username: <input type="text" name="user"><br>
    Password: <input type="password" name="pass"><br>
    <input type="submit" value="Login"></form>
    access.php
    PHP Code:
    <?php

        
    if ($_POST['user']=="") { $_POST['user'] = ""; }

    @
    header'Location: index.htm' ) ;

    $else ;

        if (
    $_POST['pass']=="") { $_POST['pass'] = ""; }

    @
    header'Location: index.htm' ) ;

    $else ;

    $conn ftp_connect("domain.com") or die("Could not connect to FTP Server, Please contact an Administrator");
    ftp_login($conn,$_POST["user"],$_POST["pass"]);
    ?>
    Last edited by Come2theDarkSide; 12-01-2008 at 08:10 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •