forgive my lack of PHP knowledge, but this is the code I had...
where should I add this bit?
my date, month and year are labelled as CCSTdate CCSTmonth CCSTyear.
<?php require_once('Connections/connDukes.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"] == "profile_add")) {
$insertSQL = sprintf("INSERT INTO tbl_users (userfirstname, userlastname, userpassword, useremail, usertel, usermob, userfax, Address1, Address2, towncity, county, postcode, hospital, grade, ccstdate, ccstmonth, ccstyear, userGroup) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($POST['userfirstname'], "text"),
GetSQLValueString($POST['userlastname'], "text"),
GetSQLValueString($POST['userpassword'], "text"),
GetSQLValueString($POST['useremail'], "text"),
GetSQLValueString($POST['usertel'], "text"),
GetSQLValueString($POST['usermob'], "text"),
GetSQLValueString($POST['userfax'], "text"),
GetSQLValueString($POST['address1'], "text"),
GetSQLValueString($POST['address2'], "text"),
GetSQLValueString($POST['towncity'], "text"),
GetSQLValueString($POST['county'], "text"),
GetSQLValueString($POST['postcode'], "text"),
GetSQLValueString($POST['hospital'], "text"),
GetSQLValueString($POST['grade'], "text"),
GetSQLValueString($POST['ccstdate'], "int"),
GetSQLValueString($POST['ccstmonth'], "int"),
GetSQLValueString($POST['ccstyear'], "date"),
GetSQLValueString($POST['Usergroup'], "text"));
mysql_select_db($database_connDukes, $connDukes);
$Result1 = mysql_query($insertSQL, $connDukes) or die(mysql_error());
$insertGoTo = "mmadmin.php";
if (isset($SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
?>