Results 1 to 2 of 2

Thread: Login script help

  1. #1
    Join Date
    Oct 2012

    Angry Login script help

    alright, I'm copying this tutorial to create a login page


    and it starting to piss me off, and I dont know why its not redirecting to the page I want to redirect

    and this is my script for the login page

    include "database-connection.php";

    // username and password sent from Form

    $sql="SELECT id FROM Account_Info WHERE UserName='$myusername' and Password='$mypassword'";


    // If result matched $myusername and $mypassword, table row must be 1 row

    header("location: http://www.adamistheschmidt.com/bkcms/home.php");

    $error="Your Login Name or Password is invalid";

    thank you for all of your help in advance

  2. #2
    Join Date
    Jul 2010
    • The "redirection" is clearly in the header function. Have you verified that page exists: copy the entire URL into the browser address and click...you should not get a "page not found/404" error
    • If the flow of code does not get to the header function, that means PHP found an error in execution at an earlier point. It usually sends the error to standard output (to your browser in the HTTP response. What does that output say?

    There are many points in your code where PHP execution errors are possible. You must not only resolve all PHP errors, but also warnings and notices...they are usually problems that should be errors.

    • is your HTTP request what it should be?? Did you set up a form (HTML form markup) with textbox elements that are named 'username' and 'password' that are transmitted with the click? Did you use the POST instead of GET method? The script wants POST.
    • is your MySQL database set up properly?
    • you have an include file: was it found?? using the require() function instead of include would given an error rather than perhaps a notice or warning.

    I have no idea how much you know about HTML markup, CSS, Javascript, PHP, or MySQL, which will be essential to your successful use of what you likely want to do.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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
HTML5 Development Center