Originally Posted by dekon
this is part of the code that i have on my login screen
$sql="SELECT * FROM user WHERE username='$myusername' and password='$mypassword'";
// If result matched $myusername and $mypassword,table is 1 row
$_SESSION['myusername'] = $myusername;
echo "Wrong Username or Password";
and this is the other part of the code where i want it so that if a user is not logged in that they will be redirected to the login page to either register their account or login could someone give me some help as to what i'm doing wwong here since it still lets you access the page without being logged on
//session is set, user is logged in
Did you try to delete your cookies. press Ctrl + Shift + Del and then re-try same thing.
Also try if($count=='1') instead of if($count==1)
Try to echo your sql queries. This will get you valuable information.
Let me know what happens.