
Originally Posted by
russellr
Hi,
The array you want to use for getting your field values is "$aCleanedValues", like this:
PHP Code:
$email = $aCleanedValues["email"];
Is this in the form or the database connection information?
Working through this but not successful yet.
I've taken all of the php mysql setup from a working page (meaning it was saving to the database) and saved it as fmhookprefinishinc. Put it in a folder called SUB and changed the link in the fmform php page.
The fmhookprefinish page is copied below:
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_LLA = "*****";
$database_LLA = "*****";
$username_LLA = ""*****";";
$password_LLA = ""*****";";
$LLA = mysql_pconnect($hostname_LLA, $username_LLA, $password_LLA) or trigger_error(mysql_error(),E_USER_ERROR);
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$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;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "SignUp")) {
$insertSQL = sprintf("INSERT INTO SUBSCRIBER (fname, lname, email, address1, address2, city, `state`, zip, comments, `date`) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['fname'], "text"),
GetSQLValueString($_POST['lname'], "text"),
GetSQLValueString($_POST['email'], "text"),
GetSQLValueString($_POST['address1'], "text"),
GetSQLValueString($_POST['address2'], "text"),
GetSQLValueString($_POST['city'], "text"),
GetSQLValueString($_POST['state'], "text"),
GetSQLValueString($_POST['zip'], "text"),
GetSQLValueString($_POST['comments'], "text"),
GetSQLValueString($_POST['date'], "date"));
mysql_select_db($database_LLA, $LLA);
$Result1 = mysql_query($insertSQL, $LLA) or die(mysql_error());
$insertGoTo = "../thankyou.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
?>
It's not working and I'm getting emails but no DB info, thus I'm not getting an error as to where to look.
Bookmarks