Can someone help with this problem.
This script work yesterday but today it won't work for some reason. I'm using the correct password and ID but it keeps telling me the my login failed. Here is a copy of the code. Thanks
This is the Form Code: Below it is the Login Code.
<p align="center"><?
if (isset($err)){
switch($err){
case 1:print("Login Expired");break;
case 2:print("Authentification failed");break;
}
}
?></p>
<form action="login.php" method="post" name="form1" id="form1" onsubmit="MM_validateForm('username','','R','password','','R');return document.MM_returnValue">
<table width="80%" border="3" align="center" cellpadding="3" cellspacing="1" bordercolor="cccc99">
<tr>
<td width="39%" align="right" bordercolor="cccc99" bgcolor="e3e3cf"><strong>Username:</strong></td>
<td width="61%" bordercolor="cccc99" bgcolor="e3e3cf"> <input type="text" name="username" /> </td>
</tr>
<tr>
<td width="39%" align="right" bordercolor="cccc99" bgcolor="e3e3cf"><strong>Password:</strong></td>
<td width="61%" bordercolor="cccc99" bgcolor="e3e3cf"> <input type="password" name="password" /> </td>
</tr>
<tr>
<td width="39%" align="right"> <input type="submit" name="Login" value="Login" />
</td>
<td width="61%"> </td>
</tr>
</table>
</form>
Here is the Login Code:
<?
include("include/connect.php");
$user_safe = mysql_escape_string($username);
$pass_safe = mysql_escape_string($password);
$r = mysql_query("Select * from fantasy_team_names where User = '$user_safe' and Pass = '$pass_safe'");
$a = mysql_fetch_array($r);
//echo "aaa";
if ( mysql_num_rows($r) == 1){ // authentication correct
session_start();
$Team_Id = $a["Team_Id"];
$Team_Name = $a["Team_name"];
// echo $Team_Name;
session_register("Team_Id");
session_register("Team_Name");
if (isset($from)) {
header("location:$from");
die;
}
}
else {
header("location: index.php?err=2");
die;
}
include("include/disconnect.php");
header("location: team.php");
?>
This script work yesterday but today it won't work for some reason. I'm using the correct password and ID but it keeps telling me the my login failed. Here is a copy of the code. Thanks
This is the Form Code: Below it is the Login Code.
<p align="center"><?
if (isset($err)){
switch($err){
case 1:print("Login Expired");break;
case 2:print("Authentification failed");break;
}
}
?></p>
<form action="login.php" method="post" name="form1" id="form1" onsubmit="MM_validateForm('username','','R','password','','R');return document.MM_returnValue">
<table width="80%" border="3" align="center" cellpadding="3" cellspacing="1" bordercolor="cccc99">
<tr>
<td width="39%" align="right" bordercolor="cccc99" bgcolor="e3e3cf"><strong>Username:</strong></td>
<td width="61%" bordercolor="cccc99" bgcolor="e3e3cf"> <input type="text" name="username" /> </td>
</tr>
<tr>
<td width="39%" align="right" bordercolor="cccc99" bgcolor="e3e3cf"><strong>Password:</strong></td>
<td width="61%" bordercolor="cccc99" bgcolor="e3e3cf"> <input type="password" name="password" /> </td>
</tr>
<tr>
<td width="39%" align="right"> <input type="submit" name="Login" value="Login" />
</td>
<td width="61%"> </td>
</tr>
</table>
</form>
Here is the Login Code:
<?
include("include/connect.php");
$user_safe = mysql_escape_string($username);
$pass_safe = mysql_escape_string($password);
$r = mysql_query("Select * from fantasy_team_names where User = '$user_safe' and Pass = '$pass_safe'");
$a = mysql_fetch_array($r);
//echo "aaa";
if ( mysql_num_rows($r) == 1){ // authentication correct
session_start();
$Team_Id = $a["Team_Id"];
$Team_Name = $a["Team_name"];
// echo $Team_Name;
session_register("Team_Id");
session_register("Team_Name");
if (isset($from)) {
header("location:$from");
die;
}
}
else {
header("location: index.php?err=2");
die;
}
include("include/disconnect.php");
header("location: team.php");
?>