<?
if(!isset($username)&&!isset($password))
{
?>
<form name="login" method="post" action="login.php">
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td><div align="left" class="yeltext">Username : </div></td>
<td><input name="username" class="formfield" type="text" id="username"></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td><div align="left" class="yeltext">Password : </div></td>
<td><input name="password" class="formfield" type="password" id="password"></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input type="submit" name="Submit" value="Login">
</div></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
</form>
<?
}
else
{
session_start();
$password = crypt($password, 'mp');
$loginq = "select count(*) from login where
login_name_txt = '$username' and login_pwd_txt = '$password' and login_active_int = '1'";
$loginr = mysql_query($loginq);
$count = mysql_result($loginr, 0, 0);
if ($count > 0)
{
echo "<div class=yeltext>\nLogin Successful</div>\n";
?>
<a href="./index2.php?<?=SID?>">Click to Complete Login</a>
<?
}
else
{
echo "login failed";
}
}
?>
That is essentially, although slightly shortened, the page form.php. What i need to do if possible is instead of having the line :
<a href="./index2.php?<?=SID?>">Click to Complete Login</a>
for the user to have to manually load the next page, for it to do this automatically. Header() returns headers already sent error, and a meta refresh will surely refresh the page regardless on whether the form has been processed.
(my apologies if the code looks a little untidy, but its only a rough draft at present... honest)