close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Cannot modify header information - headers already sent by

Thread began 4/30/2013 8:36 pm by JBWebWorks | Last modified 5/01/2013 9:35 am by JBWebWorks | 798 views | 2 replies |

JBWebWorks

Cannot modify header information - headers already sent by

I know this is somewhat common, but can't seem to figure it out from other threads.

Error message --- Cannot modify header information - headers already sent by (output started at /home/content/15/8359915/html/registeredUsers_Registration.php:61) in /home/content/15/8359915/html/registeredUsers_Registration.php on line 92

Here is my code

php:
<?php require_once('Connections/conncoressentinc.php'); ?>

<?php 
require_once("WA_ValidationToolkit/WAVT_Scripts_PHP.php"); ?>
<?php 
require_once("WA_ValidationToolkit/WAVT_ValidatedForm_PHP.php"); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function 
GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
{
  if (
PHP_VERSION 6) {
    
$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;
}
}

$colname_rs_users "-1";
if (isset(
$_POST['userEmail'])) {
  
$colname_rs_users = ($_POST['userEmail']);
}
mysql_select_db($database_conncoressentinc$conncoressentinc);
$query_rs_users sprintf("SELECT * FROM registeredUsers WHERE userEmail = %s"GetSQLValueString($colname_rs_users"text"));
$rs_users mysql_query($query_rs_users$conncoressentinc) or die(mysql_error());
$row_rs_users mysql_fetch_assoc($rs_users);
$totalRows_rs_users mysql_num_rows($rs_users);
?>
<?php 
if (isset($_POST["Register"]))  {
  
$WAFV_Redirect "registeredUsers_Registration.php";
  
$_SESSION['WAVT_registeredUsersRegistration_Errors'] = "";
  if (
$WAFV_Redirect == "")  {
    
$WAFV_Redirect $_SERVER["PHP_SELF"];
  }
  
$WAFV_Errors "";
  
$WAFV_Errors .= WAValidateNM($totalRows_rs_users "",-1,0,"",",.",true,1);

  if (
$WAFV_Errors != "")  {
    
PostResult($WAFV_Redirect,$WAFV_Errors,"registeredUsersRegistration");
  }
}
?>  
<?php  
$editFormAction 
$_SERVER['PHP_SELF'];
if (isset(
$_SERVER['QUERY_STRING'])) {
  
$editFormAction .= "?" htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset(
$_POST["MM_insert"])) && ($_POST["MM_insert"] == "WAATKRegistrationForm")) {
  
$insertSQL sprintf("INSERT INTO registeredUsers (company_name, first_name, last_name, job_title, address1, address2, country, city, `state`, zip, userEmail, userPassword, phone, phone_extension) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
                       
GetSQLValueString($_POST['company_name'], "text"),
                       
GetSQLValueString($_POST['first_name'], "text"),
                       
GetSQLValueString($_POST['last_name'], "text"),
                       
GetSQLValueString($_POST['job_title'], "text"),
                       
GetSQLValueString($_POST['address1'], "text"),
                       
GetSQLValueString($_POST['address2'], "text"),
                       
GetSQLValueString($_POST['country'], "text"),
                       
GetSQLValueString($_POST['city'], "text"),
                       
GetSQLValueString($_POST['state'], "text"),
                       
GetSQLValueString($_POST['zip'], "text"),
                       
GetSQLValueString($_POST['userEmail'], "text"),
                       
GetSQLValueString($_POST['userPassword'], "text"),
                       
GetSQLValueString($_POST['phone'], "text"),
                       
GetSQLValueString($_POST['phone_extension'], "text"));

  
mysql_select_db($database_conncoressentinc$conncoressentinc);
  
$Result1 mysql_query($insertSQL$conncoressentinc) or die(mysql_error());

  
$insertGoTo "registeredUsers_LogIn.php";
  if (isset(
$_SERVER['QUERY_STRING'])) {
    
$insertGoTo .= (strpos($insertGoTo'?')) ? "&" "?";
    
$insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  
header(sprintf("Location: %s"$insertGoTo));
}
?>
Sign in to reply to this post

CraigRBeta Tester

It looks like you have some trailing spaces after the closing php tag on line 60

Sign in to reply to this post

JBWebWorks

Thanks CraigR,

that was what it was; i thought that i had removed all white spaces, but i guess i missed some.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...