Theres an error on this script,
A mate of mine has asked me to look at this for him, and to try and fix it.
the error message he gets is
"return_msg=no_good"
once he trys to login to his profile based website \ page
heres the form that is used for collecting the login information
<link href="style/main.css" rel="stylesheet" type="text/css" />
<div align="center">
<form id="gslogin" name="gslogin" method=POST action="scripts/login.php">
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<div align="center">
<input name="email" type="text" class="textfield" id="email" value="email address" />
</div></td>
<td><div align="center">
<input name="pass" type="password" class="textfield" id="pass" value="password" />
</div></td>
<td>
<div align="center">
remember me >>> <input type="checkbox" name="remember" id="remember" />
</div> </td>
<td>
<input name="submit" type="submit" class="textfield" id="submit" value="Login" />
</td>
</tr>
</table>
</form>
</div>
and the login.php page to get the posted email and pass, the error message that is printed at when submitting the form, is at the bottom of the login form here below, I have tried a few times to remove the message, change the variables being passed. ie. from email to mail and pass to password but then the form is blank once i click login - iv no idea how to fix this .
Iv also tried to change the if ($_POST != "") to
if ($_POST != ""), but again, the form is just white
but the username and password being entered are correct ??
<?php
if ($_POST['email'] != "") {
include_once "connect_to_mysql.php";
$email = $_POST['email'];
$pass = $_POST['pass'];
$remember = $_POST['remember']; // Added for the remember me feature
$email = strip_tags($email);
$pass = strip_tags($pass);
$email = mysql_real_escape_string($email);
$pass = mysql_real_escape_string($pass);
$email = eregi_replace("`", "", $email);
$pass = eregi_replace("`", "", $pass);
$pass = md5($pass);
//make query
$sql = mysql_query("SELECT * FROM Goodisonpark WHERE email='$email' AND password='$pass' AND email_activated='1'");
$login_check = mysql_num_rows($sql);
if($login_check > 0){
while($row = mysql_fetch_array($sql)){
$id = $row["id"];
session_register('id');
$_SESSION['id'] = $id;
$firstname = $row["firstname"];
session_register('firstname');
$_SESSION['firstname'] = $firstname;
$email = $row["email"];
session_register('email');
$_SESSION['email'] = $email;
mysql_query("UPDATE Goodisonpark SET last_log_date=now() WHERE id='$id'");
} // close while
// Remember Me Section Addition... if member has chosen to be remembered in the system
if($remember == "yes"){
setcookie("idCookie", $id, time()+60*24*60*60, "/"); // 60 days; 24 hours; 60 mins; 60secs
setcookie("firstnameCookie", $firstname, time()+60*24*60*60, "/"); // 60 days; 24 hours; 60 mins; 60secs
setcookie("emailCookie", $email, time()+60*24*60*60, "/"); // 60 days; 24 hours; 60 mins; 60secs
setcookie("passCookie", $pass, time()+60*24*60*60, "/"); // 60 days; 24 hours; 60 mins; 60secs
}
$my_msg = "all_good";
print "return_msg=$my_msg&id=$id&firstname=$firstname";
} else {
$my_msg = "no_good";
print "return_msg=$my_msg";
exit();
}
}// close if post
?>