First form: Administrator can view members usernames and choose from drop down list.
Second Form: Take selected value from first form and view contents of the row based on the selected username while being able to replace any data that is within those fields, which when submitted updates the fields.
Problem:
I can't seem to get the selected value from the first form to go into the second form. I have tried hidden fields, $_POST, etc. I'm not really good with php - most times it's all trial and error.
Here is the first form, viewm.php:
Code: Select all
<? $sql="SELECT userID, username FROM $db_table";
$result=mysql_query($sql);
$options="";
while ($row=mysql_fetch_array($result)) {
$id=$row["userID"];
$viewmember=$row["username"];
$options.="<OPTION VALUE="$id">".$viewmember;
}
?>
<form action="viewm2.php" method="post">
<table width="450" border="0" cellspacing="0" cellpadding="0" align="center">
<tr valign="bottom">
<td width="216"><blockquote>
<p>Member Name:</font></p>
</blockquote></td>
<td width="234" valign="top">
<select name="viewmember">
<option value=0>Choose
<? echo $options ?></option>
</select></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td></td>
<td> <br>
<input name="Submit" type="image" src="../../../images/viewmprofilesm.png" width="171" height="34">
<BR>
<input type="hidden" name="Submit" value="View Member">
</td>
</tr>
</table>
</form>How can I correctly pass the viewmember value to my second form?
Thanks!
feyd | Please use
Code: Select all
tags when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]