View Full Version : drop down menu action help

05-16-2004, 05:49 PM
How do i make dropdown menus do something?? I am making a imagr gallery which shows one image at a atime out of a estimate of 15, i would like a drop down menu which changes the picture when you select something from it , I would like it to goto a certain site!!! in this case pictures.php?image=002 or something like that... can you help ??

05-16-2004, 06:55 PM
if your dropdown is part of a form you probably want to change the action of the form to the selected dropdown url .. thats a javascript thing so moving you there

[unless you have your form goto another PHP page which then redirects via the selected form DD value

form_action.php (where goto is the name of your <select> field)

if( !empty( $_REQUEST['goto'] ) ){
header( "location:{$_REQUEST['goto']}" );

05-16-2004, 07:07 PM
what bout my option field

05-16-2004, 07:12 PM
<form id="bella" action="form_action.php" method="POST">
<select name="goto">
<option value="http://www.php.net">php.net</option>
<option value="http://www.apache.org">apache</option>

05-16-2004, 08:39 PM
<form action="gallery.php" method="get">
<select name="image">

<option value="1"></option>
<input type="submit" value="go">

Can you tell me.... why i get the result image=+1
that ok apart from the + bit
can that disappear?