What the hell is wrong with this script?
This is the html forum
<HTML>
<HEAD>
<TITLE>TheADM</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<link href="/pages/page.css" rel="stylesheet" type="text/css">
</HEAD>
<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
<form method="get" action="verify.php">
<table width=1006 border=0 cellpadding=0 cellspacing=0>
<!--DWLayoutTable-->
<tr>
<td width="820" height="93" valign="top" bordercolor="#000000" bgcolor="#adb4d3"><p align="center">
<p></p>
<p></p></td>
<td width="186" valign="top"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td height="16" colspan="2" valign="top" bordercolor="#000000" bgcolor="#666699">
<div align="right"><a href="/index.php">Home</a> | <a href="/pages/Photos.php">Photos</a>
| <a href="/pages/Downloads.php">Downloads</a> | <a href="/pages/Guestbook.php">Guestbook</a>
| <a href="/pages/Links.php">Links</a> | <a href="/pages/login.php">Login</a></div></td>
</tr>
</table>
<TABLE width="1006" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<!--DWLayoutTable-->
<tr valign="top" bgcolor="#FFFFFF">
<td width="197" height="34" valign="top" bgcolor="#ededed" class="sidebar" style=".sidebar">
<h3 align="center">Welcome!</h3>
<td colspan="6" valign="top"><h3>Please login:</h3></td>
</tr>
<tr>
<td rowspan="6" valign="top" bgcolor="#ededed" class="sidebar" style=".sidebar">klklkl
<td height="18" colspan="6" valign="top"><!--DWLayoutEmptyCell--> </td>
<tr valign="top" bgcolor="#ededed">
<td height="22" colspan="3" valign="top" bgcolor="#FFFFFF"><h3>Username:</h3></td>
<td colspan="2" valign="top" bgcolor="#FFFFFF"> <input name="user" type="text">
</td>
<td width="495" rowspan="3" valign="top" bgcolor="#FFFFFF"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr valign="top" bgcolor="#ededed">
<td height="22" colspan="3" valign="top" bgcolor="#FFFFFF"><h3>Password:</h3></td>
<td colspan="2" valign="top" bgcolor="#FFFFFF"><input name="pass" type="password"></td>
</tr>
<!--<tr valign="top" bgcolor="#ededed">
<td height="22" colspan="3" valign="top" bgcolor="#FFFFFF"><h3>Remember
me? </h3></td>
<td colspan="2" valign="top" bgcolor="#FFFFFF">Yes:
<input type="checkbox" name="checkbox" value="checkbox"></td>
</tr>//-->
<tr>
<td width="49" height="24" valign="top"><!--DWLayoutEmptyCell-->
<td width="61" valign="top"><input type="submit" name="submit" value="Submit">
<td colspan="2" valign="top"><div align="center">Or</div>
<td width="145" valign="top"><input type="reset" name="clear" value="Clear">
<td valign="top"><!--DWLayoutEmptyCell--> </td>
<tr valign="top" bgcolor="#ededed">
<td height="184" colspan="6" valign="top" bgcolor="#FFFFFF"> </td>
</tr>
<tr valign="top" bgcolor="#ededed">
<td height="18" valign="top" bgcolor="#666699" bordercolor="#000000"> </td>
<td colspan="6" valign="top" bordercolor="#000000" bgcolor="#666699"> </td>
</tr>
<tr>
<td height="0"></td>
<td></td>
<td></td>
<td width="36"></td>
<td width="23"></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="1"><img src="/html/images/spacer.gif" alt="" width="197" height="1"></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
<table width="1006" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="1006" height="64" valign="top" bgcolor="#adb4d3"> <p align="center">Copyright
2003</p>
<p align="center">TheADM</p></td>
</tr>
</table>
</form>
</BODY>
</HTML>
This is the actual php that validates the form
I hardcoded the values.
<?php
$user_h = 'Zero';
$pass_h = 'Ch3faNt';
if ($user == $user_h && $pass == $pass_h)
{session_start();
//Register a session
session_register('USERNAME');
$USERNAME = $user;
header('Redirect: ./index.php');
}
else
{echo "Wrong credentials";}
?>
And here is how its used:
<?php
session_start();
?>
<HTML>
<HEAD>
<TITLE>TheADM</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<link href="/pages/page.css" rel="stylesheet" type="text/css">
</HEAD>
<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
<!-- ImageReady Slices (TheADM.psd) -->
<TABLE WIDTH=1006 BORDER=0 CELLPADDING=0 CELLSPACING=0>
<!--DWLayoutTable-->
<TR>
<TD width="820" height="93" valign="top" bordercolor="#000000" bgcolor="#adb4d3"><p align="center">
<p></p>
</p></TD>
<TD width="186" valign="top"><p><?php
if (isset($USERNAME))
{echo "You are currentlly logged in as '$USERNAME'";}
else
{echo "Not logged in.";}
?></p></TD>
</TR>
<TR>
<TD height="16" colspan="2" valign="top" bordercolor="#000000" bgcolor="#666699">
<div align="right"><a href="/index.php">Home</a> | <a href="/pages/Photos.php">Photos</a>
| <a href="/pages/Downloads.php">Downloads</a> | <a href="/pages/Guestbook.php">Guestbook</a>
| <a href="/pages/Links.php">Links</a> | <a href="/pages/login.php">Login</a></div></TD>
</TR>
</TABLE>
<TABLE width="1006" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<!--DWLayoutTable-->
<tr valign="top" bgcolor="#FFFFFF">
<td width="197" height="34" valign="top" bgcolor="#ededed" class="sidebar" style=".sidebar">
<h3 align="center">Welcome!</h3>
<td width="809" rowspan="2" valign="top"><a href="/MPanel/index.php">TestLink
To MySQL</a></td>
</tr>
<tr valign="top" bgcolor="#ededed">
<td height="245" valign="top">klklkl </tr>
<tr valign="top" bgcolor="#ededed">
<td height="18" valign="top" bgcolor="#666699" bordercolor="#000000"><!--DWLayoutEmptyCell-->
<td valign="top" bordercolor="#000000" bgcolor="#666699"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td height="0"></td>
<td></td>
</tr>
<tr>
<td height="1"><img src="/html/images/spacer.gif" alt="" width="197" height="1"></td>
<td></td>
</tr>
</table>
<table width="1006" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="1006" height="64" valign="top" bgcolor="#adb4d3"> <p align="center">Copyright
2003</p>
<p align="center">TheADM</p></td>
</tr>
</table>
</BODY>
</HTML>
Note: This is the full source of 3 of my pages, so please don't copy it.
Help!