what is this error :
Warning: Cannot send session cache limiter - headers already sent (output started at /var/www/html/persian/servieces/forum/Login.php:1) in /var/www/html/persian/servieces/forum/Login.php on line 3
----------php code (login page) ----------------
<?php //PHP ADODB document - made with PHAkt 2.1.0?>
<?php
session_start(); // start session.
?>
<?php
mysql_connect("database", "username", "password")
or die("Could not connect");
mysql_select_db("table") or die(mysql_error());
?>
<!-- header tags, edit to match your own, or include template header file. -->
<html>
<head>
<title>Login</title>
<head>
<body>
<?php
if(!isset($username) | !isset($password)) {
// escape from php mode.
?>
<form action="<?=$PHP_SELF?><?if($QUERY_STRING){ echo"?". $QUERY_STRING;}?>" method="POST">
<p align="center">Members only. Please login to access this document.</p>
<table align="center" border="0">
<tr>
<th>
Username:
</th>
<th>
<input type="text" name="username">
</th>
</tr>
<tr>
<th>
Password:
</th>
<th>
<input type="password" name="password">
</th>
</tr>
<tr>
<th colspan="2" align="right">
<input type="submit" value="Login">
</form>
</th>
</tr>
</table>
</body>
</html>
<?
exit();
}
// If all is well so far.
session_register("username");
session_register("password"); // register username and password as session variables.
// Here you would check the supplied username and password against your database to see if they exist.
// For example, a MySQL Query, your method may differ.
$sql = mysql_query("SELECT id,password FROM users WHERE username = '$username'");
$fetch_em = mysql_fetch_array($sql);
$numrows = mysql_num_rows($sql);
session_register("id");
$_SESSION['id']= $fetch_em["id"];
if($numrows != "0") {
if ($password = $fetch_em["password"]){
$valid_user = 1;
echo $fetch_em["password"];
echo $fetch_em["id"];
echo "yes";
list($q,$w,$e) = gregorian_to_jalali("2003","01","28");
$jdatea = $q."/".$w."/".$e;
echo date("Y-m-d");
echo $jdatea;
mysql_query("UPDATE users SET last_login = '$jdatea' WHERE username = '$username'");
}
} else {
echo $numrows."---".$password."---";
echo $fetch_em["password"];
$valid_user = 0;
echo "no";
}
// If the username exists and pass is correct, don't pop up the login code again.
// If info can't be found or verified....
if (!($valid_user))
{
session_unset(); // Unset session variables.
session_destroy(); // End Session we created earlier.
// escape from php mode.
?>
<form action="<?=$PHP_SELF?><?if($QUERY_STRING){ echo"?". $QUERY_STRING;}?>" method="POST">
<p align="center">Incorrect login information, please try again. You must login to access this document.</p>
<table align="center" border="0">
<tr>
<th>
Username:
</th>
<th>
<input type="text" name="username">
</th>
</tr>
<tr>
<th>
Password:
</th>
<th>
<input type="password" name="password">
</th>
</tr>
<tr>
<th colspan="2" align="right">
<input type="submit" value="Login">
</form>
</th>
</tr>
</table>
</body>
</html>
<?
exit();
}
?>
please help
thanks.