mATOK Posted September 29, 2006 Share Posted September 29, 2006 When I click submit my url changes to client=4&fname=NAME&lname=LAST&e-mail=NAME.LAST%40SOMEWHERE.cominstead of[b]task=2[/b]&fname=NAME&lname=LAST&e-mail=NAME.LAST%40SOMEWHERE.com$sql = "SELECT * FROM Customer ORDER BY Name"; $res = mssql_query($sql); if (!$client_select) { echo "<form name=\"Add-Customer\" action=\"borealis-connect.php?task=1\" method=\"get\">"; echo "<table border=\"0\"><tr><td>Company</td>"; echo"<td><select name=\"client\" onchange=\"document.location='borealis-connect.php?task=1&client='+escape(this.value);\">"; while ($customerS = mssql_fetch_array($res)){ echo "<option value=\"".$customerS['CustomerID']."\">".$customerS['Name']; } echo "</td></tr>"; } elseif ($client_select) { echo "<form name=\"Add-Customer\" action=\"borealis-connect.php?task=2\" method=\"get\">"; echo "<table border=\"0\"><tr><td>Company</td>"; $sql2 = "SELECT * FROM Customer WHERE CustomerID = '$client_select'"; $res2 = mssql_query($sql2); while ($blah = mssql_fetch_array($res2)) { echo "<td><select name=\"client\"><option value=\"".$client_select."\">".$blah['Name']."</td>"; }?> </tr> <tr><td>First Name</td><td><input type="text" name="fname" size="30" /></td></tr> <tr><td>Last Name</td><td><input type="text" name="lname" size="30" /></td></tr> <tr><td>E-Mail</td><td><input type="text" name="e-mail" size="30" /></td></tr> <tr><td colspan="2"><br /><input type="Submit" value="Submit"></td></tr><?php }?> </table></form> Link to comment https://forums.phpfreaks.com/topic/22501-please-tell-me-why-this-does-not-work/ Share on other sites More sharing options...
wildteen88 Posted September 29, 2006 Share Posted September 29, 2006 Add a hidden field called task instead before your submit button:[code]<tr><td colspan="2"><input type="hidden" name="task" value="2" /><input type="Submit" value="Submit"></td></tr>[/code] Link to comment https://forums.phpfreaks.com/topic/22501-please-tell-me-why-this-does-not-work/#findComment-100885 Share on other sites More sharing options...
mATOK Posted September 29, 2006 Author Share Posted September 29, 2006 THANK YOU VERY MUCHAny tips on how to improve this code, or do you think its ok as is? Link to comment https://forums.phpfreaks.com/topic/22501-please-tell-me-why-this-does-not-work/#findComment-100887 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.