Greetings,
I am having some trouble passing a URL variable after an insert on a form action.
Here is my script below it seems i have everything right, but im not sure why the variable does not show up in the URL when i hit submit and it moves to the next page.
Can anyone see where im making my mistake?
<?php
//Environment Variables
//putenv("LD_LIBRARY_PATH=/home/db2admin/sqllib/lib");
//putenv("DB2INSTANCE=db2admin");
//Connection statement
require_once('../Connections/orsdb2.php');
//Aditional Functions
require_once('../includes/functions.inc.php');
// build the form action
$editFormAction = $HTTP_SERVER_VARS['PHP_SELF'] . (isset($HTTP_SERVER_VARS['QUERY_STRING']) ? "?REQ_ID_RMS=" . $HTTP_SERVER_VARS['QUERY_STRING'] : "");
if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO OCM.SPEC_HANDLING_REQ (requester_rms, phone_rms, request_rms, otherreq_rms, req_time_rms, req_date_rms) VALUES (%s, %s, %s, %s, %s, %s)",
GetSQLValueString($HTTP_POST_VARS['requester_rms'], "text"),
GetSQLValueString($HTTP_POST_VARS['phone_rms'], "text"),
GetSQLValueString($HTTP_POST_VARS['request_rms'], "text"),
GetSQLValueString($HTTP_POST_VARS['otherreq_rms'], "text"),
GetSQLValueString($HTTP_POST_VARS['req_time_rms'], "text"),
GetSQLValueString($HTTP_POST_VARS['req_date_rms'], "text"));
$Result1 = $orsdb2->Execute($insertSQL) or die($orsdb2->ErrorMsg());
$insertGoTo = "../reqhandling/currentrpt.php";
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
}
KT_redir($insertGoTo);
}
// begin Recordset
$colnameRecordset1 = '-1';
if (isset($HTTP_POST_VARS['req_id_rms'])) {
$colnameRecordset1 = $HTTP_POST_VARS['req_id_rms'];
}
$query_Recordset1 = sprintf("SELECT * FROM OCM.SPEC_HANDLING_REQ WHERE REQ_ID_RMS = %s", $colname__Recordset1);
$Recordset1 = $orsdb2->SelectLimit($query_Recordset1) or die($orsdb2->ErrorMsg());
$totalRows_Recordset1 = $Recordset1->RecordCount();
// end Recordset
//PHP ADODB document - made with PHAkt 2.5.0
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><!-- InstanceBegin template="/Templates/reqmanage.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Special Handling Request</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
<link href="/css/linkcolor.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0">
<div align="left">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="52" align="left" valign="top" nowrap bgcolor="#008A72">
<div align="left">
<table width="500" height="54" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="149" height="52" nowrap bgcolor="#FFFFFF"><img src="../graphics/IPCO02c.jpg" width="210" height="52"></td>
<td width="729" height="52" valign="middle" nowrap bgcolor="#008A72">
<blockquote>
<p><em><font color="#FFFFFF" size="6" face="Times New Roman, Times, serif">
<strong> Operations Request System</strong></font></em></p>
</blockquote>
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr bgcolor="#333333">
<td height="22" valign="middle" nowrap bgcolor="#000000">
<table width="730" height="22" border="0" align="left" cellpadding="1" cellspacing="0" bordercolor="#CCCCCC" bgcolor="#000000">
<tr>
<td nowrap>
<div align="center"><strong><font color="#FFFFFF">:: </font></strong><a class="one" href="../index.php"><font color="#FFFFFF">Home</font></a><font color="#FFFFFF"><strong>
::</strong></font></div>
</td>
<td nowrap>
<div align="center"><strong><font color="#FFFFFF">:: </font></strong><a class="one" href="shrform.php"><font color="#FFFFFF">S.H.R.</font></a><font color="#FFFFFF"><strong>
::</strong></font></div>
</td>
<td nowrap>
<div align="center"><strong><font color="#FFFFFF">::</font></strong>
<a class="one" href="srform.php"><font color="#FFFFFF">Scheduling
Request</font></a><font color="#FFFFFF"> <strong>::</strong></font></div>
</td>
<td nowrap>
<div align="center"></div>
</td>
<td nowrap>
<div align="center"></div>
</td>
<td nowrap>
<div align="center"><strong><font color="#FFFFFF">:: Help </font></strong><font color="#FFFFFF"><strong>::</strong></font></div>
</td>
</tr>
</table>
</td>
</tr>
<tr bgcolor="#CCCCCC">
<td height="86" align="left" valign="top" bgcolor="#E8E8E8">
<div align="left"><!-- InstanceBeginEditable name="EditRegion1" -->
<h1 align="center"><strong><font size="5"><br>
Special Handling Request </font></strong></h1>
<form action="<?php echo $editFormAction; ?>" method="POST" name="form1" id="form1">
<table align="center">
<tr valign="baseline">
<td nowrap align="right">Requester:</td>
<td><input type="text" name="requester_rms" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Time:</td>
<td><input type="text" name="req_time_rms" value="<?php print(date('G:i')); ?>" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Date:</td>
<td><input type="text" name="req_date_rms" value="<?php print(date('m/d/Y')); ?>" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Phone #:</td>
<td><input type="text" name="phone_rms" value="" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right" valign="top">Request:</td>
<td> <textarea name="request_rms" cols="50" rows="5"></textarea>
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right" valign="top">Other:</td>
<td> <textarea name="otherreq_rms" cols="50" rows="5"></textarea>
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right"> </td>
<td><input name="" type="submit" value="Submit">
</td>
</tr>
</table>
<div align="left"></div>
<div align="left"></div>
<div align="left">
<input type="hidden" name="req_id_rms" value="<?php echo $HTTP_POST_VARS['req_id_rms'];?>">
</div>
<input type="hidden" name="MM_insert" value="form1">
</form>
<p> </p>
<strong> </strong><!-- InstanceEndEditable -->
<p> </p>
</div>
</td>
</tr>
</table>
<p> </p>
</div>
</body>
<!-- InstanceEnd --></html>
<?php
$Recordset1->Close();
?>