I need help!
I'm using sessions to protect some pages from unauthorized users.
Here is my code:
When there is a match in the database:
In the protected page:
The code works perfectly on my local machine, but when I upload to dreamhost.com it keeps redirecting me to the login page regardless I type the wrong credentials or the right ones. The database is fine, and the tables include the login information the I use to log in!
Any thoughts??
I'm using sessions to protect some pages from unauthorized users.
Here is my code:
When there is a match in the database:
Code:
session_start();
session_register("username");
header("location:index.php");
In the protected page:
Code:
session_start();
if(!isset($_SESSION['username']))
{
header("location:login.php");
}
The code works perfectly on my local machine, but when I upload to dreamhost.com it keeps redirecting me to the login page regardless I type the wrong credentials or the right ones. The database is fine, and the tables include the login information the I use to log in!
Any thoughts??







