redirect not working
hi,
everytime i add the insert record to an existing form the redirect does not work.
no errors on server when i turn error reports on.
all it does is add a ? to the page currently on.
the code generated by dw is:
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "AddSupplier")) {
$insertSQL = sprintf("INSERT INTO suppliers (SupplierName, SupplierTel, SupplierEmail) VALUES (%s, %s, %s)",
GetSQLValueString($_POST['PartsManufacturer'], "text"),
GetSQLValueString($_POST['PartsManufacturerTel'], "text"),
GetSQLValueString($_POST['PartsManufacturerEmail'], "text"));
mysql_select_db($database_cbank, $cbank);
$Result1 = mysql_query($insertSQL, $cbank) or die(mysql_error());
$insertGoTo = "supplier_Results.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
the form code is:
<form action="" method="post" class="clear" name="AddSupplier" id="AddSupplier" >
<ol>
<li style="">
<label for="PartsManufacturer">Parts Manufacturer Name</label>
<input type="text" id="PartsManufacturer" name="PartsManufacturer" value=""/>
</li>
<li>
<label for="PartsManufacturerTel">Parts Manufacturer Tel</label>
<input type="text" id="PartsManufacturerTel" name="PartsManufacturerTel" value="" />
</li>
<li>
<label for="PartsManufacturerEmail">Parts Manufacturer Email</label>
<input type="text" id="PartsManufacturerEmail" name="PartsManufacturerEmail" value="<?" />
</li>
</ol>
<input name="DummyName" type="hidden" value="1" />
<p style="text-align:right;">
<input type="reset" value="CANCEL" />
<input type="submit" name="OK" id="OK" value="OK" />
</p>
<input type="hidden" name="MM_insert" value="AddSupplier" />
</form>
using dw cs4.
any help appreciated.
many thanks
