Form Processing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sacksey
    New Member
    • Feb 2007
    • 4

    Form Processing

    Hi. I am new to PHP and would like some help with my select list. I have looked at many places but unfortanately, tutorials I have looked at are either not what I'm specifically looking for or do not even cover them. I'm looking to have a select list and upon selecting an option, it displays an image under the list.

    Code:
    	<form name="jump" method="post" action="/routes.php">
    		<p align="center">
    		<select name="menu">
    		<option value="/x.php?=0">Select a Route</option>
    		<option value="/x.php?=1">1</option>
    		<option value="/x.php?=4">4</option>
    		<option value="/x.php?=15">15</option>
    		</select>
    		<input type="button" onClick="GO">
          </form>
    Code:
    <?
    	if (value == 0) {
    		echo '<img>/images/allroutes.gif</img>';
    		echo '';
    	}
    	else if (value == 1) {
    		echo "<img>/images/route01.gif</img>";
    		echo "";
    	}
    	else if (value == 4) {
    		echo '<img>/images/route04.gif</img>';
    		echo '';
    	}
    	else if (value == 15) {
    		echo '<img>/images/route15.gif</img>';
    		echo '';
    ?>
    Thank you
  • ak1dnar
    Recognized Expert Top Contributor
    • Jan 2007
    • 1584

    #2
    <form name="jump" method="post" action="routes. php">
    <p align="center">
    <select name="menu">
    <option value="0">Selec t a Route</option>
    <option value="1">1</option>
    <option value="4">4</option>
    <option value="15">15</option>
    </select>
    <input type="button" onClick="GO">
    </form>


    and from the NEXT page use

    <img src="Your Image location" />

    After 38 posts you know by now that you must display your code within code or php tags!!! Otherwise it will be removed.

    moderator
    Last edited by ronverdonk; Mar 4 '07, 03:45 PM. Reason: warning

    Comment

    Working...