Forum Moderators: coopster

Message Too Old, No Replies

Newbie needs help

         

nicuz

2:33 am on Apr 3, 2006 (gmt 0)



Hi everybody.

I am building a webpage with cell phone and accessories ads. Basically when someone wants to sell his/her cell phone will post an ad on my webpage.

I want to create a list/menu with the 3 categories (phones, accessories, cards), and pass the 3 values to category.php page.

Here's the code for the list/menu so far which is contained in the choose.php file:

echo "<select name='category'>\n";
echo "<option name='category' value='phones'>Phones</option>\n";
echo "<option name='category' value='accessories'>Accessories</option>\n";
echo "<option name='category' value='cards'>Cards</option>\n";
echo "</select>";

The query for the category.php page looks like this:
$query = "SELECT * FROM ad WHERE (and I want the value passed from the list/menu in here)"

I would also like to mention that the list/menu should have a onChange auction (I do not want a submit button) and it should take you to category.php page(this is also the page where the values should be passed to).

Thank you in advance.

Habtom

4:08 am on Apr 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



$query = "SELECT * FROM ad WHERE ad.category = '". $_REQUEST['$category']";

will do.

//I would also like to mention that the list/menu should have a onChange auction

on the form action you need to metion what you need to do.

Search for what you can do on onClick

Habtom