Adobe Dreamweaver Forums



Last 10 THreads :         Embedded hyperlink doesn't work (Last Post : Racer-EX - Replies : 1 - Views : 2 )           »          Does WebHelp support help-system-user definedbookmarks/favorites? (Last Post : Racer-EX - Replies : 5 - Views : 6 )           »          Image icons disappear when CPD is deleted (Last Post : Alan_Davidson - Replies : 3 - Views : 4 )           »          RoboHelp & Knowledge Bases (Last Post : shealy1 - Replies : 0 - Views : 1 )           »          Strange behavior with x86_64 Flash and Firefox 3.0.4 (Last Post : mmmarilyn - Replies : 2 - Views : 3 )           »          advice please (Last Post : Rob Dillon - Replies : 2 - Views : 3 )           »          Unable to initialize Shared Memory (Last Post : Alejux - Replies : 7 - Views : 9 )           »          Streaming audio - buffering mid-stream (Last Post : Tim - Replies : 0 - Views : 1 )           »          unlinking shared assets (Last Post : dmodie - Replies : 2 - Views : 3 )           »          outputting bitmap path from xml file (Last Post : Rob Dillon - Replies : 1 - Views : 2 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Dreamweaver: Main > Dreamweaver Application Development
 
Tags:



Reply
  #1 (permalink)  
Old 10-01-2008, 01:49 PM
debrankin55
 
Posts: n/a
Diggs:
Default all new php code now sends the header already sentwarning

I have had none of these 'headers already sent....' problems creating php forms
in the past with dreamweaver cs3 (on leopard). Now, every single php form
generated using dreamweaver returns this warning - without fail. I copied the
EXACT code from a working login form into a new page.....the new page, using
the same include file is now returning the warning: I am pasting the code that
works, and below that, the code that does not work. Even Developer Toolkit, on
the rare occasion it doesn't cause DW to crash, seems to be inserting code that
does not work properly - same goes for the insert > data objects.

I've attached the code from both pages - page that works at the top, page that
doesn't work at the bottom:




<?php require_once('Connections/ContactForm.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "",
$theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

$theValue = function_exists("mysql_real_escape_string") ?
mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" :
"NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

mysql_select_db($database_ContactForm, $ContactForm);
$query_Recordset1 = "SELECT * FROM contact";
$Recordset1 = mysql_query($query_Recordset1, $ContactForm) or
die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<?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['email'])) {
$loginUsername=$_POST['email'];
$password=$_POST['user'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "private.php";
$MM_redirectLoginFailed = "failed.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_ContactForm, $ContactForm);

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

$LoginRS = mysql_query($LoginRS__query, $ContactForm) 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 );
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">





<?php require_once('Connections/ContactForm.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "",
$theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

$theValue = function_exists("mysql_real_escape_string") ?
mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" :
"NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

mysql_select_db($database_ContactForm, $ContactForm);
$query_Recordset1 = "SELECT * FROM contact";
$Recordset1 = mysql_query($query_Recordset1, $ContactForm) or
die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<?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['email'])) {
$loginUsername=$_POST['email'];
$password=$_POST['user'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "private.php";
$MM_redirectLoginFailed = "failed.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_ContactForm, $ContactForm);

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

$LoginRS = mysql_query($LoginRS__query, $ContactForm) 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 );
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>

<body>
<form id="form1" name="form1" method="POST" action="<?php echo
$loginFormAction; ?>">
<p>email address:
<input type="text" name="email" id="email" />
<br />
<br />
last name:
<input type="password" name="user" id="user" />
</p>
<p>
<input type="submit" name="submit" id="submit"
value="Submit" />
</p>
</form>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>



Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 07:06 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk