hello all..i guess i need some help with u all experts here
i got a problem with two drop down list and a submit button.i want to make the submit button display an image following the condition of select listi want people select from drop down list 1 and drop down list 2,hit the submit button and display the image on the other page.fyi,im doing system similar with google map direction where people choose from one location to another location and when click the "get direction" button the map image will display
here's my code
<?php
$select1=$_POST["select1"];
$select2=$_POST["select2"];
if (!isset($_POST['submit']))
?>
</label>
<label></label>
<form id="form3" name="form3" method="post" action="<?php echo $PHP_SELF;?>">
<p> </p>
<p> </p>
<div id="Layer19">
<select name="select1">
<option value="" <?php if (!(strcmp("", $row_jj['name']))) {echo "selected=\"selected\"";} ?>>- Please Select -</option>
<?php
do {
?>
<option value="<?php echo $row_jj['id']?>"<?php if (!(strcmp($row_jj['id'], $row_jj['name']))) {echo "selected=\"selected\"";} ?>><?php echo $row_jj['name']?></option>
<?php
} while ($row_jj = mysql_fetch_assoc($jj));
$rows = mysql_num_rows($jj);
if($rows > 0) {
mysql_data_seek($jj, 0);
$row_jj = mysql_fetch_assoc($jj);
}
?>
<?php
if($_POST["select1"] == "")
{
mysql_select_db($database_connect_db, $connect_db);
$query_kk = "SELECT * FROM route WHERE location_1 = $select1 ";
$kk = mysql_query($query_kk, $connect_db) or die(mysql_error());
$row_kk = mysql_fetch_assoc($kk);
$totalRows_kk = mysql_num_rows($kk);
while($row_kk = mysql_fetch_assoc($kk));
$gambo = stripslashes( $row_kk['image']);
}
echo $kk;
?>
</select>
<p>
<input type="image" name="gambo" src="<?php echo $row_kk['image']; ?>"/>;
</p>
</div>
<p> </p>
<p>
</p>
<p> </p>
<p>
<label>
<input type="submit" name="Submit" value="Submit" />
</label>
</p>
<p> </p>
<p> </p>
<p> </p>
<select name="select2">
<option value="" <?php if (!(strcmp("", $row_jj['name']))) {echo "selected=\"selected\"";} ?>>- Please Select -</option>
<?php
do {
?>
<option value="<?php echo $row_jj['id']?>"<?php if (!(strcmp($row_jj['id'], $row_jj['name']))) {echo "selected=\"selected\"";} ?>><?php echo $row_jj['name']?></option>
<?php
} while ($row_jj = mysql_fetch_assoc($jj));
$rows = mysql_num_rows($jj);
if($rows > 0) {
mysql_data_seek($jj, 0);
$row_jj = mysql_fetch_assoc($jj);
}
?>
</select>
</form>
i got 2 tables in database which is table 1 is "location" contain field "id" and "name".the 2nd table contain 5 field contain "id","loc1","loc2","image" and "text".
plz help me on doing this,im quite new to php