After login , I want to do admin_menu.php...but why????
Warning: Cannot modify header information - headers already sent by (output started at D:\users\imagiq\login\check.php:23) in D:\users\imagiq\login\check.php on line 38
check.php
<?php
session_start();
$sessid=session_id();
if ($session['userid'])
{
header("Location: http://localhost/~imagiq/admin_menu.php?session=<?$session['userid']?>");
}
if ($POST['submit'] && $POST['user'] && $_POST['passwd']) {
$conn=mysql_connect("localhost","root","");
mysql_select_db("imagiq",$conn);
//$test = mysql_result(mysql_query("SELECT COUNT() FROM users WHERE user='".$POST['user']."' AND passwd=MD5('".$POST['passwd']."')"),0);
$sql = "SELECT COUNT() FROM users WHERE user='".$POST['user']."' AND passwd=password('".$POST['passwd']."')";
$rs = mysql_query($sql);
$test = mysql_result($rs,0);
}
if ($test == 1) {
$userid= mysql_result(mysql_query("SELECT id FROM users WHERE user='".$POST['user']."' AND passwd=password('".$POST['passwd']."')"),0);
$_SESSION['userid'] = $userid;
//header( "http://localhost/imagiq/admin_menu.php");
header("Location: http://localhost/~imagiq/admin_menu.php?session=<?$_SESSION['userid']?>");
}
else
{
mysql_close($conn);
session_destroy();
echo '<html>
<head>
<title>Login failed!</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" text="#000000" link="#000000" vlink="#000000" alink="#000000" background="../images/bg5.gif">
Invalid login. Please try again <a href="login.php">here</a>
</body>
</html>';
}
?>