Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Login failure (cannot modify header) PHP/MySQL

New Here ,
Mar 16, 2007 Mar 16, 2007
I have a login form 100% Dreamweaver8 built using PHP/MySQL. After logging in it fails to goto the $MM_redirectLoginSuccess page (index.php). I did not have this issue prior to the 8.02 update. I designed it the same way as I had before the 8.02 update. I have checked multiple times for whitespace before and after the PHP open and close tags in Dreamweaver and other text editors.

Below is what info is needed I hope.

Error
PHP Warning: Cannot modify header information - headers already sent by (output started at /var/www/web4/web/login.php:4) in /var/www/web4/web/login.php on line 72, referer:
Code (All Dreamweaver 8 Generated)
<?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 = "Account_Type";
$MM_redirectLoginSuccess = "index.php";
$MM_redirectLoginFailed = "loginfailed.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_dnsturtle, $dnsturtle);

$LoginRS__query=sprintf("SELECT Email, Password, Account_Type FROM accounts WHERE Email=%s AND Password=%s",
GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));

$LoginRS = mysql_query($LoginRS__query, $dnsturtle) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {

$loginStrGroup = mysql_result($LoginRS,0,'Account_Type');

//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 ); --------------------Line 72
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}
?>
TOPICS
Server side applications
259
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 16, 2007 Mar 16, 2007
I take it you have an include file as well on the page, to reference the
database? Check in there for whitespace.


--
Gareth
http://www.phploginsuite.co.uk/
PHP Login Suite V2 - 34 Server Behaviors to build a complete Login system.


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 16, 2007 Mar 16, 2007
LATEST
I already checked that also. Again it is whatever Dreamweaver created in the Connections folder.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines