get wrong post value from drop down query options
Posted: Thu Jun 03, 2010 11:57 pm
New to PHP and working with an Xamp installation of PHP 5.3.1 and MYSQL 5.1.41 on an XP system and developing with LOCALHOST
This is the small code section that is causing me the problem:
The upper portion of this code is and that is where the next session values are being created and saved:
if (isset($_POST['submitted'])) {
$_SESSION['comments']=$_REQUEST['comments']; //this value is being returned and stored correctly.
$_SESSION['mysig']=$_REQUEST['mysig']; //This is the problem value as it is returning the "relcusid" instead of "mysig"
So problem is I am getting the customer cusid value instead of the username and title value that is to be inserted in the next form.
Mahalo for your help
This is the small code section that is causing me the problem:
Code: Select all
<p><b>Special Notes :</b> <textarea name="comments"
rows="3" cols="40">
</textarea>
</fieldset>
</p> <hr /> <br />
<?php
require_once ('./php/mysql_connect.php'); // Connect to the db.
$cusid=$_SESSION['cusid'];
$query="SELECT relcusid, concat(authsign,' [', signtitle, ']') as [b]mysig[/b] FROM relsignor
WHERE relcusid=$cusid";
$result = mysql_query ($query);
echo "<select name = [b]mysig [/b]value=''>[b]mysig[/b]</option>";
// printing the list box select command
while($nt=mysql_fetch_array($result)){//Array or records stored in $nt
echo "<option value=$nt[relcusid]>$nt[[b]mysig[/b]]</option>";
/* Option values are added by looping through the array */
}
echo "</select>";// Closing of list box
?>
<p><b>Signature to use: </b> </p><br />
<hr />
<div align="center"><input type="submit"
name="submit" value="Submit My Information" />
<input type="hidden" name="submitted" value="TRUE" />
</div>
</form>if (isset($_POST['submitted'])) {
$_SESSION['comments']=$_REQUEST['comments']; //this value is being returned and stored correctly.
$_SESSION['mysig']=$_REQUEST['mysig']; //This is the problem value as it is returning the "relcusid" instead of "mysig"
So problem is I am getting the customer cusid value instead of the username and title value that is to be inserted in the next form.
Mahalo for your help