Drop down menu

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply

Is this possible?

Yes.
5
83%
No.
1
17%
 
Total votes: 6

postalservice14
Forum Newbie
Posts: 2
Joined: Thu May 30, 2002 4:14 pm
Location: OR, USA
Contact:

Drop down menu

Post by postalservice14 »

How do I make a drop down menu that displays information from a table.

example:

Name - email - username
- Name2 - email2 - username2
- Name3 - email3 - username3
- Name4 - email4 - username4
- Name5 - email5 - username5

But when it submits I want it to goto a certain web page, depending on what I choose.

Thanks if you can help,

John
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

You have to query the database to get the data, then you run a loop to create an HTML form with a select box. You then (in the same page or another) have a bit of script that runs when the form is submitted and use that to determine what web page to forward to based on the choice made.

Check out the following:
http://www.php.net/manual/en/ref.mysql.php
http://www.php.net/manual/en/language.v ... efined.php
http://www.php.net/manual/en/function.header.php

This is sort of a rough outline of the steps you'd take to accomplish what you're looking for.

Mac
postalservice14
Forum Newbie
Posts: 2
Joined: Thu May 30, 2002 4:14 pm
Location: OR, USA
Contact:

Thanks

Post by postalservice14 »

Alright....I think I have it figured out....Thank you all that helped me

John
Post Reply