Hello
I need some solution for the following problem:
I would like to let user choose one item from the drop down box and then update the page with the image of the chosen item.
I’m really new to web programming so I was hoping if I could get any help from experts ?
Here’s my code (even though it’s mostly useless ?) but I think you will understand what I tried to accomplish.
[code=php]
<?php
if (!isset($_REQUEST[‘imagelist’]))
{ $currentImage=”1/0.jpg”; }
else
{ $currentImage=$_REQUEST[‘imagelist’];}
?>
Then the drop down box
[code=php]
<select name=”imagelist”
onchange=”javascript:window.location=’index.php’;”>
<?php
for ($i = $numberOfImages; $i > 1; $i–) { echo ‘<option value=’.$i.’/0.jpg>Image ‘.$i.'</option>’ ; }
?>
And image
[code=php]
<img src=”<?php echo $currentImage ?>” class=”currentImage”/>
Only thing that is really bugging me is the first part, where i try to assign chosen item from the drop down box to a php value. I know that some java would come in handy and my code is pretty noob-ish, but I just started with web programming, so any help would be very much appreciated.