Undefined variable - help
Posted: Sat Mar 27, 2004 9:19 am
Hi everyone
First off al I want to say it is my first PHP “project “ – in my life - so newbie I am (LOL) all postings on this forum - seems to me like “magician world”(LOL) – people are talking and I don’t know what about …
but somewhere have to be … the first step … very go !
I made a page with a data - where client should write its information (add- user-record.php) and after submit - button - data is stored - and this page should recall other page (continue updating information - $insertGoTo = "booking_details.php?email=$email")booking_details.pht .
All what I got is an error - what is wrong ? ( I know me LOL)
any help ?
Thanks
First off al I want to say it is my first PHP “project “ – in my life - so newbie I am (LOL) all postings on this forum - seems to me like “magician world”(LOL) – people are talking and I don’t know what about …
but somewhere have to be … the first step … very go !
I made a page with a data - where client should write its information (add- user-record.php) and after submit - button - data is stored - and this page should recall other page (continue updating information - $insertGoTo = "booking_details.php?email=$email")booking_details.pht .
All what I got is an error - what is wrong ? ( I know me LOL)
Notice: Undefined variable: email in c:\inetpub\wwwroot\dreamweaverhotel\booking\add_user_record.php on line 50
Warning: Cannot modify header information - headers already sent by (output started at c:\inetpub\wwwroot\dreamweaverhotel\booking\add_user_record.php:50) in c:\inetpub\wwwroot\dreamweaverhotel\booking\add_user_record.php on line 55
Code: Select all
<?php require_once('../Connections/phpbook.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, telephone, 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'], "int"),
GetSQLValueString($_POSTї'email'], "text"));
mysql_select_db($database_phpbook, $phpbook);
$Result1 = mysql_query($insertSQL, $phpbook) or die(mysql_error());
$insertGoTo = "booking_details.php?email=$email";
if (isset($_SERVERї'QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVERї'QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
?>Thanks