Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > Adobe Web Programming > BOOK: Dreamweaver MX: PHP Web Development
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Dreamweaver MX: PHP Web Development
This is the forum to discuss the Wrox book Dreamweaver MX: PHP Web Development by Gareth Downes-Powell, Tim Green, Bruno Mairlot; ISBN: 9780764543876
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Dreamweaver MX: PHP Web Development section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old December 25th, 2005, 11:39 PM
Registered User
 
Join Date: Dec 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default P128 " . $HTTP_POST_VARS['email'] ." trouble

I am having trouble with my add_user_record.php page. Whenever I submit the information, I get an error message stating:

Warning: Cannot modify header information - headers already sent by (output started at c:\inetpub\wwwroot\dreamweaverhotel\add_user_recor d.php:1) in c:\inetpub\wwwroot\dreamweaverhotel\add_user_recor d.php on line 55

Here is my code lines through opening HTML tag:

<?php require_once('Connections/connHotel.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
  $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $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;
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "userform")) {
  $insertSQL = sprintf("INSERT INTO clients (title, firstName, lastName, address1, address2, town, province, country, postCode, tel, email) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
                       GetSQLValueString($_POST['title'], "text"),
                       GetSQLValueString($_POST['firstName'], "text"),
                       GetSQLValueString($_POST['lastName'], "text"),
                       GetSQLValueString($_POST['address1'], "text"),
                       GetSQLValueString($_POST['address2'], "text"),
                       GetSQLValueString($_POST['town'], "text"),
                       GetSQLValueString($_POST['province'], "text"),
                       GetSQLValueString($_POST['country'], "text"),
                       GetSQLValueString($_POST['postcode'], "text"),
                       GetSQLValueString($_POST['telephone'], "text"),
                       GetSQLValueString($_POST['email'], "text"));

  mysql_select_db($database_connHotel, $connHotel);
  $Result1 = mysql_query($insertSQL, $connHotel) or die(mysql_error());

  $insertGoTo = "add_user_record.php?email=" . $HTTP_POST_VARS['email'] ."";
  if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $insertGoTo));
}
?>
<html>

Please help! Thank you.

Shawn Walsh

Reply With Quote
  #2 (permalink)  
Old March 5th, 2009, 12:38 PM
Authorized User
 
Join Date: Mar 2009
Posts: 11
Thanks: 1
Thanked 0 Times in 0 Posts
Default

$insertGoTo = "add_user_record.php?email=" . $HTTP_POST_VARS['email'] ."";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];

change the link to booking_details.php?
Reply With Quote
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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
If Else Trouble Cibressus Beginning PHP 0 May 1st, 2007 02:04 PM
Please i have had a Trouble hurted Wrox Book Feedback 1 June 28th, 2004 02:18 AM
trouble with Email and PHP Tachyon Beginning PHP 3 May 26th, 2004 03:58 AM
trouble databass Classic ASP Databases 2 August 16th, 2003 10:27 AM



All times are GMT -4. The time now is 05:18 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.