Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jul 2011
    Posts
    141
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Header not working

    PHP Code:
    <?php
    include('config.php'); 
    if (isset(
    $_POST['submit'])) 

    $username$_POST['username']; 
    $password$_POST['password']; 
    $myusername mysql_real_escape_string($username); 
    $mypassword mysql_real_escape_string($password);   
    $sql="SELECT * FROM users WHERE username='$myusername' and password='$mypassword'"
    $resultmysql_query($sql) or die(mysql_error()); 

      
    // If result matched $myusername and $mypassword, table row must be 1 row 
    if($row mysql_fetch_array($result)) { 
    $userid $_SESSION['id'] = $row['id'];     
    $username $_SESSION['username'] = $row['username'];   
    header("Location: welcome.php"); 

    else{ 
    echo 
    "Wrong username or password."




    }
    ?>

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Now you're just angering me.
    Stop posting threads over and over for a problem you already have a thread open for.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)


  •  

    Tags for this Thread

    Posting Permissions

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