I can NOT figure out why this code won’t work. It seems to work fine in the tutorial I followed. I have the code copied the exact same way the tutorial said to. and ive googled my problem and can’t figure it out… when I press the “Login!” button on my login.php file, the page does not redirect to admin.php… here is my code… in my, “if else” statement, the else will echo text, but when i try to make the else redirect to a new session it won’t work, it just loads a blank login.php page… here is my code and the youtube tutorial I followed… http://www.youtube.com/watch?v=IPahfwPjEhI… If you can figure it out email [email protected] thank you so much!!!
login.php
[php]
if($num == 0) {
echo "Bad login go <a href='login.php'>back</a>";
}else{
//I BELIEVE THE PROBLEM HAS SOMETHING TO DO WITH THE FOLLOWING 3 LINES… HELP!
session_start();
$_SESSION[‘name’] = $name;
header(‘Location: admin.php’);
}
}
else{
?>
<form action='login.php' method='post'>
Username: <input type='text' name='name' /><br />
Password: <input type='password' name='password' /><br />
<input type='submit' name='submit' value='Login!' />
</form>
<?php
}
?>
</body>
[/php]