Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| 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 Search this Thread Display Modes
  #1 (permalink)  
Old March 5th, 2009, 01:37 PM
Authorized User
 
Join Date: Mar 2009
Posts: 11
Thanks: 1
Thanked 0 Times in 0 Posts
Default $HTTP_POST_VARS['email'];

is not working for some reason ... it is not taking the entered text from email field and add it to the end of the link instead its stuck on some entry i made and gives me those names

p 128 in the book
Reply With Quote
  #2 (permalink)  
Old March 5th, 2009, 01:57 PM
Authorized User
 
Join Date: Mar 2009
Posts: 11
Thanks: 1
Thanked 0 Times in 0 Posts
Default


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['Surname'], "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 = "booking_details.php?email=" . $HTTP_POST_VARS['email'] . "";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
Reply With Quote
  #3 (permalink)  
Old March 10th, 2009, 02:04 PM
Authorized User
 
Join Date: Mar 2009
Posts: 11
Thanks: 1
Thanked 0 Times in 0 Posts
Lightbulb SOLUTION!

Wow thanks to Phil from different forum or thread all you have to do is replace the $http_post_vars['email'] to $_POST['email'] and it works perfectly.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
C# and Email iceman90289 C# 2005 8 June 25th, 2008 11:44 AM
ASP EMAIL tommyt ASP.NET 1.0 and 1.1 Basics 1 June 20th, 2006 10:31 PM
email keyvanjan Classic ASP Basics 2 March 20th, 2006 12:05 AM



All times are GMT -4. The time now is 12:26 PM.


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