Forum Moderators: coopster
I have this script which is genearted from Dreamweaver when i made this login page, but get this error message.
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent in /home/www/public_html/logging.php on line -465204464
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/www/public_html/logging.php:-465204464) in /home/www/public_html/logging.php on line -2138252160
as you can see i do not have a line -2138252160
the code below is the whole page, sorry if its long, thought best post the lot.
<?php virtual('/Connections/login.php');?>
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
session_start();
}
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
$_SESSION['PrevUrl'] = $_GET['accesscheck'];
}
if (isset($_POST['username'])) {
$loginUsername=$_POST['username'];
$password=$_POST['password'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "/deals.html";
$MM_redirectLoginFailed = "/logging.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_login, $login);
$LoginRS__query=sprintf("SELECT user, password FROM users WHERE user='%s' AND password='%s'",
get_magic_quotes_gpc()? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc()? $password : addslashes($password));
$LoginRS = mysql_query($LoginRS__query, $login) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = "";
//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;
if (isset($_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}
?>
<title>Untitled Document</title>
<body>
<div align="center">
<form ACTION="<?php echo $loginFormAction;?>" name="form1" method="POST">
<table width="400" border="0" cellspacing="0" cellpadding="3">
<tr>
<td width="100">Username:</td>
<td><input name="username" type="text" id="username"></td>
</tr>
<tr>
<td width="100">Password:</td>
<td><input name="password" type="password" id="password"></td>
</tr>
<tr>
<td width="100"> </td>
<td><input type="submit" name="Submit" value="Submit"></td>
</tr>
</table>
</form>
</div>
</body>
Thanks very much in advance.