I have a page called admin.php and inside it, it makes it where you can go to admin.php?page=Submit and admin.php?page=Edit. I want both pages to be locked to everybody but the users, but only Submit does it. Here is my code for admin.php:
<?
include("dbconnect.php");
$username = $_POST["username"];
$password = $_POST["password"];
$email = $_POST["email"];
$result = MYSQL_QUERY("SELECT * from users WHERE username='$username'and
password='$password'and email='$email'")
or die ("Name and password not found or not matched");
$worked = mysql_fetch_array($result);
$username = $worked[username];
$password = $worked[password];
$email = $_POST["email"];
if($worked){
if($page == "Submit")
{
echo "
test
";
}
elseif($page == "Edit")
{
echo "testing.";
}
}
?>
How do I get it to check the user with $page == "Edit" too?