ahhhh... this script is really pissin me off and i don't no what the heck is wrong with it, plz help. other refrence http://www.teampanic.net/index2.php
script :
<?
include("members/config.php");
include("cookie.php");
$head = <<<ENDH
<!-- Creation date: 06/05/2002 -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Team Panic version 0.5</title>
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="author" content="_xIcEx__">
<meta name="generator" content="AceHTML 5 Pro">
<style type="text/css">
A{color: #151515;
font-family: "Verdana";
font-weight: "Bolder";
font-size: 11px;
text-decoration: "none";
padding-left: 10px;}
A:hover{color: #808080;}
</style>
</head>
<body leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0" bgcolor="#333333">
<table summary="Main Table Layout" border="0" cellpadding="0" cellspacing="0" width="779">
<tr>
<td colspan="3"><img src="images/logo.jpg"></td>
</tr>
<tr width"125">
<td>
<table border="0" cellpadding="0" cellspacing="0" width="125">
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" width="100%" background="images/bg.jpg">
<tr>
<td><img src="images/navigation.jpg"></td>
</tr>
<tr>
<td height="10"></td>
</td>
<tr>
<td><a href="index.php">News</a></td>
</tr>
<tr>
<td><a href="#">Members</a></td>
</tr>
<tr>
<td><a href="#">Schedule</a></td>
</tr>
<tr>
<td><a href="#">Rules</a></td>
</tr>
<tr>
<td><a href="#">Join Us</a></td>
</tr>
<tr>
<td height="10"></td>
</td>
<tr>
<td><img src="images/forums.jpg"></td>
</tr>
<tr>
<td height="10"></td>
</td>
<tr>
<td><a href="http://www.teampanic.net/cgi-bin/ikonboard/ikonboard.cgi?act=SF;f=4">[TP] Café</a></td>
</tr>
<tr>
<td><a href="http://www.teampanic.net/cgi-bin/ikonboard/ikonboard.cgi?act=SF;f=5">Gaming</a></td>
</tr>
<tr>
<td height="10"></td>
</td>
<tr>
<td><img src="images/divisions.jpg"></td>
</tr>
<tr>
<td height="10"></td>
</td>
<tr>
<td><a href="#">Counter-Strike</a></td>
</tr>
<tr>
<td height="10"></td>
</tr>
<tr>
<td><img src="images/login.jpg"></td>
</tr>
<tr>
<td height="10"></td>
</tr>
ENDH;
$tail = <<<ENDT
</table>
<td>
</tr>
<tr>
<td><img src="images/curve.jpg"></td>
</tr>
</table>
</td>
<td width="653" valign="top"><table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr valign="top">
<td><center>News</center></td>
</tr>
<tr>
<td>Blah</td>
</tr>
<tr>
<td>Copyright..</td>
</tr>
</table>
</td>
</table>
</body>
ENDT;
if (!$$tp_last) {
echo $head;
?>
<tr>
<td><form action="<? echo $PHP_SELF; ?>" method="POST">
<table border="0">
<tr>
<td>Username:</td>
</tr>
<tr>
<td><p align="center"><input type="text" name="username" size="12" maxlength="20"></td>
</tr>
<tr>
<td>Password:</td>
</tr>
<tr>
<td><input type="password" name="password" size="12" maxlength="20"></td>
</tr>
<tr>
<td><p align="center"><input type="submit" name="submit" value="Login"></td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td height="10"></td>
</tr>
<?
echo $tail;
exit;
if($submit) {
$connect = mysql_connect($host, $name, $pass);
mysql_select_db($db, $connect);
$query = "SELECT id FROM members WHERE uname = '$username'";
$result = mysql_query($query);
$num_rows = mysql_num_rows($result);
$row = mysql_fetch_array($result);
$user_id = $row[0];
if ($user_id == "") {
setcookie ($tp_user, "", time()-$cookie_life);
setcookie($tp_pass, "", time()-$cookie_life);
echo "incorrect username";
} else {
$query = "SELECT password FROM members WHERE uname = '$username'";
$result = mysql_query($query);
$encryptedpassword = md5($password);
$row = mysql_fetch_array($result);
$passwordfromdb = $row[0];
if ($encryptedpassword == $passwordfromdb) {
setcookie ($tp_user, $cuser, time()+$cookie_life);
setcookie($tp_pass, $cpass, time()+$cookie_life);
$$tp_user = $username;
$$tp_pass = $password;
} else {
setcookie ($tp_user, "", time()-$cookie_life);
setcookie($tp_pass, "", time()-$cookie_life);
echo "Bad pass";
mysql_close($connect);
}
}
}
}
if (isset($username) | isset($password)) {
echo $head;
?>
Welcome back to our system, <?php echo $$tp_user ?>.
<?php
if($$tp_last)
echo "Your last login was on " . $$tp_last . ".";
?>
<tr>
<td>You are logged in.</td>
</tr>
<tr>
<td><a href="logout.php">Logout</a></td>
</tr>
<tr>
<td height="10"></td>
</tr>
<tr>
<td><img src="images/members.jpg"></td>
</tr>
<tr>
<td height="10"></td>
</tr>
<? echo $tail; }?>