Hi! I'm having an issue with my authentication.php, from the Chipmunk Foum board. Before I post the code, I'd like to post the form I'm using to submit it, and then the php code.
<table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="black">
<tr>
<form name="submit" method="post" action="authenticate.php">
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="white">
<tr>
<td colspan="3" align="center"><strong>Member Login </strong></td>
</tr>
<tr>
<td width="78">Username</td>
<td width="6">:</td>
<td width="294"><input name="user" type="text" value="user" onfocus="this.value=''; this.onfocus=null"></td>
</tr>
<tr>
<td>Password</td>
<td>:</td>
<td><input name="password" type="password" value="**********" onfocus="this.value=''; this.onfocus=null"></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><input align="center" type="submit" name="submit" value="SUBMIT"></td>
</tr>
</table>
authentication.php:
<?PHP
session_start();
include "connect.php";
if (isset($_POST['submit'])) // name of submit button
{
$username=$_POST['user'];
$username=strip_tags($username);
$username=trim($username);
if(!ctype_alnum($username))
{
print "There were invalid characters in your name.";
}
else
{
$password=$_POST['password'];
$password=strip_tags($password);
$password=trim($password);
$password=md5($password);
$query = "select * from accounts where playerName='$username' and playerPass='$password' and validated='1'";
$result = mysql_query($query) or die("MySQL Error");
$result2=mysql_fetch_array($result);
if($result2)
{
$_SESSION['user']=$username;
if($_POST['remember'])
{
$memberid=$result2[userID];
$passkey=$result2[password];
include "admin/var.php";
$cookie1="[0]";
$cookie2="[1]";
$cookie3="$cookiename$cookie1";
$cookie4="$cookiename$cookie2";
setcookie("$cookie3","$memberid",time()+7776000,'/',".chipmunk-scripts.com") ;
setcookie("$cookie4","$passkey",time()+7776000,'/',".chipmunk-scripts.com") ;
}
print "<center>";
print "<link rel='stylesheet' href='../templates/default/boardstyle.css' type='text/css'>";
print "<table class='maintable'>";
print "<tr class='headline'><td><center>Logging In</center></td></tr>";
print "<tr class='forumrow'><td><center>";
print "logged in successfully.";
print "Redirecting to forum Index <META HTTP-EQUIV = 'Refresh' Content = '2; URL =main.php'></center>";
print "</td></tr></table></center>";
}
}
}
else
{
print "<center>";
print "<link rel='stylesheet' href='style.css' type='text/css'>";
print "<table class='maintable'>";
print "<tr class='headline'><td><center>Logging In</center></td></tr>";
print "<tr class='forumrow'><td><center>";
print "Wrong username or password or unactivated account, redirecting back to login page... <META HTTP-EQUIV = 'Refresh' Content = '2; URL =index.php'></center>";
print "</td></tr></table></center>";
}
?>
What happens is when I post a username/password to that, all I get is a blank page.