Question
Insert Recordset - Redirect Url not working - PHP
I'm trying to insert a record then jump to a confirmation
page, but I can't seem to get it to work. The record is inserted
but the page doesn't redirect. I get no error message. Here's the
PHP code:
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "addform")) {
$insertSQL = sprintf("INSERT INTO bios (bio_personname, bio_persontitle) VALUES (%s, %s)",
GetSQLValueString($_POST['bio_personname'], "text"),
GetSQLValueString($_POST['bio_persontitle'], "text"));
mysql_select_db($database_connCasey_fcs, $connCasey_fcs);
$Result1 = mysql_query($insertSQL, $connCasey_fcs) or die(mysql_error());
$insertGoTo = "/faculty/bios/confirm_test.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "addform")) {
$insertSQL = sprintf("INSERT INTO bios (bio_personname, bio_persontitle) VALUES (%s, %s)",
GetSQLValueString($_POST['bio_personname'], "text"),
GetSQLValueString($_POST['bio_persontitle'], "text"));
mysql_select_db($database_connCasey_fcs, $connCasey_fcs);
$Result1 = mysql_query($insertSQL, $connCasey_fcs) or die(mysql_error());
$insertGoTo = "/faculty/bios/confirm_test.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
