Hi
I’m making a website and I’m making a login for admins and a login for users.
I was able to manually create an admin user using phpmyadmin and when I tried to login it worked.
but I did the same this on the user page but I keep getting and error404 everytime i try to login
I’ve not made a register page I entered a user manually using phpmyadmin
here is the code for my user login page:
[php]<?php
session_start();
if (isset($_SESSION[“manager”])) {
header(“location: index.php”);
exit();
}
?>
Please Login:
Username:Password:
<input type="submit" name="button" id="button" value="Log In" />
</form>
<p> </p>
</div>
<br />
and this is the page it should redirect me to after logging in, index.php:
[php]<?php
session_start();
if (!isset($_SESSION[“manager”])) {
header(“location: user_login.php”);
exit();
}
// Be sure to check that this manager SESSION value is in fact in the database
$managerID = preg_replace(’#[^0-9]#i’, ‘’, $_SESSION[“id”]); // filter everything but numbers and letters
$manager = preg_replace(’#[^A-Za-z0-9]#i’, ‘’, $_SESSION[“manager”]); // filter everything but numbers and letters
$password = preg_replace(’#[^A-Za-z0-9]#i’, ‘’, $_SESSION[“password”]); // filter everything but numbers and letters
// Run mySQL query to be sure that this person is an admin and that their password session var equals the database information
// Connect to the MySQL database
include “…/storescripts/connect_to_mysql.php”;
$sql = mysql_query(“SELECT * FROM user WHERE id=’$managerID’ AND username=’$manager’ AND password=’$password’ LIMIT 1”); // query the person
// ------- MAKE SURE PERSON EXISTS IN DATABASE ---------
$existCount = mysql_num_rows($sql); // count the row nums
if ($existCount == 0) { // evaluate the count
echo “Your login session data is not on record in the database.”;
exit();
}
?>
please help me figure out this error.
thankyou 