Current location: Hot Scripts Forums » Programming Languages » PHP » defining variables


defining variables

Reply
  #1 (permalink)  
Old 08-18-04, 09:05 AM
puppy puppy is offline
Newbie Coder
 
Join Date: Apr 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
defining variables

hi, - I could really use some help.
I have a page where clients submit their email for notification emails and another confirming their subscription.

the php for the email page is:

<?php require_once('Connections/Tayltd.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 = $HTTP_SERVER_VARS['PHP_SELF'];
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING'];
}

if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "app_email")) {
$insertSQL = sprintf("INSERT INTO applicants (email) VALUES (%s)",
GetSQLValueString($HTTP_POST_VARS['textfield'], "text"));

mysql_select_db($database_Tayltd, $Tayltd);
$Result1 = mysql_query($insertSQL, $Tayltd) or die(mysql_error());

$insertGoTo = "TAsubConfirm.php";
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
?>

the relevant php for the confirmation page is:

<?php
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
echo "We will be pleased to notify you of any new property. We have sent a confirmation
email to: $thevalue.";

?>

I get Notice undefined variable rows 86 & 88 when testing the confirm page.

thanks in advance

rob
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Server side variables Puno PHP 13 08-13-05 10:22 PM
Can anyone help me ? (problem using php variables in html db insert code) chronic_ PHP 2 06-13-04 11:19 AM
Session variables for navigation Puno PHP 0 04-12-04 04:28 AM
help with displaying variables tisza PHP 9 12-22-03 05:08 PM
adding more variables to the mail() result spinicrus PHP 6 08-28-03 04:55 PM


All times are GMT -5. The time now is 04:20 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.