macromedia.dreamweaver.appdev
[Top] [All Lists]

Insert Recordset - Redirect Url not working - PHP

Subject: Insert Recordset - Redirect Url not working - PHP
From: "casey_g"
Date: Mon, 20 Aug 2007 22:28:44 +0000 UTC
Newsgroups: macromedia.dreamweaver.appdev

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));


<Prev in Thread] Current Thread [Next in Thread>