mysql php - simple lookup - super noob
phuschnickens
Beverly Hills, Michigan Member
I'm a super noob. Working on a VERY basic site. Here's the goal..
1. User types in password. No username.
2. Password determines what page to go to. (can direct to an html file at this point)
My mysql database consists of one table named pass with two fields in it.
One field is pass, one is orgnum (orgnum will indicate which page to go to 'orgnum'.html).
I have code that checks the password and forwards to a new page if successful (login_successful.php). That's where I'm lost. Don't know how to get login_successful.php to either populate with the correct html file or simply redirect to the correct html file.
Please help. Let me know if you need to see code etc.
Thanks in advance!
1. User types in password. No username.
2. Password determines what page to go to. (can direct to an html file at this point)
My mysql database consists of one table named pass with two fields in it.
One field is pass, one is orgnum (orgnum will indicate which page to go to 'orgnum'.html).
I have code that checks the password and forwards to a new page if successful (login_successful.php). That's where I'm lost. Don't know how to get login_successful.php to either populate with the correct html file or simply redirect to the correct html file.
Please help. Let me know if you need to see code etc.
Thanks in advance!
0
Comments
Just have a check at the top to get the correct page from the db and then put that url into the header function.
Thanks y'all
[php]
$password = stripslashes($_POST);
$sql = sprintf("SELECT orgnum FROM pass WHERE pass='%s'", $password);
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
$pg = $row;
header("Location: $pg");
[/php]