Hi guys im trying to get a login script working that redirects people to there own area but im getting this error
Warning: Cannot add header information - headers already sent by (output started at /home/4523 **** etc
The code to help is below
<html>
<head>
<title>AdultInfo4u.co.uk - escort listings - xxx galleries and more...</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="styles.css" type="text/css">
<script language="JavaScript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<script type='text/javascript'>
function Go(){return}
</script>
<script type='text/javascript' src='menu_var.js'></script>
<script type='text/javascript' src='menu_com.js'></script>
<noscript>Your browser does not support script</noscript>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/logo.gif" width="259" height="35"></td>
</tr>
<tr>
<td width="690" height="30" id="MenuPos" style="position:relative"></td>
</tr>
</table>
<table width="700" border="0" cellspacing="1" cellpadding="0" bgcolor="#000000">
<tr>
<td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td align="center" valign="top">
<?php
include "common.php";
$link = mysql_connect("$server", "$username", "$password")
or die("Could not connect");
mysql_select_db("$db") or die("Could not select database");
if (empty($page)) $page = "";
if ($page == login) {
$result = mysql_query("SELECT user, pass FROM user WHERE user = '$user'");
while ($i = mysql_fetch_array($result)) {
if ($pass == $i[pass]) {
Header("Location: $url/members/index.php?user=$user");
Setcookie($user, $pass);
}
}
}
?>
<form action=login.php?page=login method=post>
<table border=0 cellpadding=2 cellspacing=0>
<tr><td><font face=arial size=2>Username: </font></td><td><input type=text name=username></td></tr>
<tr><td><font face=arial size=2>Password: </font></td><td><input type=password name=password></td></tr>
<tr><td colspan=2><input type=submit value="Change Info"></td></tr>
</table>
</form>
</td>
</tr>
</table> </td>
</tr>
</table>
</body>
</html>
Thankyou for any help as this is doing my head in
Aaron