Jump to content


Photo

How to use Post and Get functions


  • Please log in to reply
1 reply to this topic

#1 flouts

flouts
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 07 November 2003 - 07:40 PM

Hi!

I am building a web site with php and i have a drop down menu with 4 different music categories in a frame at the left of the page.When u click an option a page opens in the main frame dispklaying all entries found in the db for the specific category.
As you understand the same query runs for all 4 categories and i want to create 1 page where i get a value from the drop down menu and pass it as a parameter to the SQL query.
I understand this must be done with post and get variables somehow but i dont know how to use them.

Somebody help?

#2 Rheal

Rheal
  • Members
  • PipPip
  • Member
  • 11 posts

Posted 12 December 2003 - 04:25 PM

Dont know if this is what you want ....but just copy paste this between Form tags and it should give you a Idea how I would do what you are trying to do.

<p align=\"center\"> <font size=\"3\">Select Operating System</font>
<select name=\"address\" size=\"1\" id=\"select4\">
<option value=\"Win98\" selected <?php if (!(strcmp(\"Win98\", $HTTP_POST_VARS[\'address\']))) {echo \"SELECTED\";} ?>>Windows
98</option>
<option value=\"WinNT\" <?php if (!(strcmp(\"WinNT\", $HTTP_POST_VARS[\'address\']))) {echo \"SELECTED\";} ?>>Windows
NT</option>
<option value=\"Win2K\" <?php if (!(strcmp(\"Win2K\", $HTTP_POST_VARS[\'address\']))) {echo \"SELECTED\";} ?>>Windows
2000</option>
<option value=\"WinXP\" <?php if (!(strcmp(\"WinXP\", $HTTP_POST_VARS[\'address\']))) {echo \"SELECTED\";} ?>>Windows
XP</option>
<option value=\"Win2003\" <?php if (!(strcmp(\"Win2003\", $HTTP_POST_VARS[\'address\']))) {echo \"SELECTED\";} ?>>Windows
2003</option>
<option value=\"Novell\" <?php if (!(strcmp(\"Novell\", $HTTP_POST_VARS[\'address\']))) {echo \"SELECTED\";} ?>>Novell</option>
<option value=\"OSX10.3\" <?php if (!(strcmp(\"OSX10.3\", $HTTP_POST_VARS[\'address\']))) {echo \"SELECTED\";} ?>>Mac
OS X 10.3</option>
<option value=\"OSX10.2\" <?php if (!(strcmp(\"OSX10.2\", $HTTP_POST_VARS[\'address\']))) {echo \"SELECTED\";} ?>>Mac
OS X 10.2</option>
<option value=\"OS9\" <?php if (!(strcmp(\"OS9\", $HTTP_POST_VARS[\'address\']))) {echo \"SELECTED\";} ?>>Mac
OS 9.2</option>
<option value=\"OS8\" <?php if (!(strcmp(\"OS8\", $HTTP_POST_VARS[\'address\']))) {echo \"SELECTED\";} ?>>Mac
OS 8</option>
<option value=\"OS7\" <?php if (!(strcmp(\"OS7\", $HTTP_POST_VARS[\'address\']))) {echo \"SELECTED\";} ?>>Mac
OS 7</option>
</select>
</p>
<p align=\"center\">






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users