Jump to content

How to use Post and Get functions


Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/1317-how-to-use-post-and-get-functions/
Share on other sites

  • 1 month later...

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.

 

  Quote

<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\">

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.