PHP Code:
if (isset ($_GET['startnew']))
{
unset($_SESSION['majorregion']);
unset($_SESSION['localarea']);
}
if (isset($_GET['majorregion']))
{
$_SESSION['majorregion'] = $_GET['majorregion'];
}
if (isset ($_GET['localarea']))
{
$_SESSION['localarea'] = $_GET['localarea'];
}
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$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"] == "fr_lv3_interest")) {
// add this:
var_dump($_POST);
die();
$insertSQL = sprintf("INSERT INTO levelthreeinterest (core, `white water`, canoe, sea, surf, freestyle, slalom, WWR, touring, polo, racing, localarea, name, email, majorregion) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['core'], "int"),
GetSQLValueString($_POST['ww'], "int"),
GetSQLValueString($_POST['canoe'], "int"),
GetSQLValueString($_POST['sea'], "int"),
GetSQLValueString($_POST['surf'], "int"),
GetSQLValueString($_POST['freestyle'], "int"),
GetSQLValueString($_POST['slalom'], "int"),
GetSQLValueString($_POST['wwr'], "int"),
GetSQLValueString($_POST['touring'], "int"),
GetSQLValueString($_POST['polo'], "int"),
GetSQLValueString($_POST['racing'], "int"),
GetSQLValueString($_POST['localarea'], "text"),
GetSQLValueString($_POST['name'], "text"),
GetSQLValueString($_POST['email'], "text"),
GetSQLValueString($_POST['majorregion'], "text"));
mysql_select_db($database_con_pyb, $con_pyb);
$Result1 = mysql_query($insertSQL, $con_pyb) or die(mysql_error());
$insertGoTo = "courses-bcu-level3-confirm.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
Bookmarks