JTekNet
03-28-2008, 06:10 PM
I'm creating a login page for my database and I was wondering how I can use an if statement or whatever I need to get to my next page based on the password user and password entered.
if ($_POST['uname'] === 'user' && $_POST['password'] === 'pass')
{
echo "worked";
} else {
echo "Sorry, wrong username / password";
}
Now I know that works. Problem is, I need to change the echo "worked"; to gotourl (userpage1.php); and gotourl obviously isn't a way to do it. I've tried sending headers but it always tells me they have already been sent. I've checked for whitespace and everything because I read that it can be an issue. There is no whitespace at the end or beginning so I'm completely clueless. HELP
if ($_POST['uname'] === 'user' && $_POST['password'] === 'pass')
{
echo "worked";
} else {
echo "Sorry, wrong username / password";
}
Now I know that works. Problem is, I need to change the echo "worked"; to gotourl (userpage1.php); and gotourl obviously isn't a way to do it. I've tried sending headers but it always tells me they have already been sent. I've checked for whitespace and everything because I read that it can be an issue. There is no whitespace at the end or beginning so I'm completely clueless. HELP