My index page is set up as a basic index page where it submits to check.php, the 2 text boxes in the index.php are called EMAIL and PASSWORD which is pretty simple and basic.
my set up page looks as follows
$db = mysql_connect("//hostname", "//username", "//password");
mysql_select_db("//dbname");
$res = mysql_query("SELECT * FROM userdb WHERE email='$email'");
$info = mysql_fetch_array($res);
$date2 = date("H:i");
function error($type)
{
if($type == "field")
{
include("style.css");
echo "<body link=#FFFFFF vlink=#FFFFFF alink=#FFFFFF bgcolor=#000000 text=#FFFFFF>";
echo "<p align=center><font color=white>You have left fields blank. Please <a href=index.php>retry</a></font></center></p>
<p align=center><img src=sonic.jpg></img></p>";
}
elseif($type == "password")
{
include("style.css");
echo "<body link=#FFFFFF vlink=#FFFFFF alink=#FFFFFF bgcolor=#000000 text=#FFFFFF>";
echo "<p align=center><font color=white>Incorrect password. Please <a href=index.php>relogin</a></font></center></p>
<p align=center><img src=sonic.jpg></img></p>";
}
}
echo "</body>";
this would connect to my database, select the database in question and make sure that the login/email properties are entered within the index page. If not entered the error message would come up saying that either information is incorrectly entered or not entered at all.
ob_start("ob_gzhandler");
session_start();
include("setup.php");
if(!$email || !$password) {
error("field");
exit();
}
if($password == $info['password']) {
session_register("password");
session_register("email");
include("top.php");
include("style.css");
if($action == "") {
echo "any content goes in here from like hyperlinks etc. once the login is successful";
}
include("bottom.php");
}
else
{
error("password");
}
ob_end_flush();
is my check page that process the whole Index.php information, from linking to the set up page it gathers the log in details and if something isn't right it will give either one of the error message aka "FIELD" if a email address is wrong/empty or "PASSWORD" if the password is incorrect or not entered.
my problem is the code is not allowing me to log into my page. When I had this page running years ago it use to work but now no matter how well I enter the details in correctly on my Index Page I can never access my account.
if you want to see what I am going on about then please attempt it yourself on a demo account I created for this @ http://www.sentuamsg.com/login (email: test@test.com password:test)