I have my form with some combo box and radio button.
And i need to display an image based on the selections.
I need to display dynamically the image when the selections are made without any submit button.
The image comes from a table where it needs to be retrieved from the selection criteria.
I have my form but i am not able to get the data from the form to display the image.
Can anyone help??
Thanking you.
My page with radio button and combo box
e.g to display maps, selection is 1
My main page.php
Expand|Select|Wrap|Line Numbers
- <tr id="displayType1" class=hide>
- <td><font color="#FFFFFF">
- <form name="displayType">
- <Input type = 'Radio'
- Name ='display'
- value= '1'
- onclick="displayMaps();"
- id='idMaps'>
- Maps
- <Input type = 'Radio'
- Name ='display'
- value= '2'
- id='idSections'
- checked
- onclick="displaySection();">
- Sections<br>
- <Input type = 'Radio'
- Name ='display'
- value= '3'
- id='idAnimation'
- onclick="displayAnimation();">
- Animations
- </form>
- </font>
- </td>
- <!--the image is displayed in the corresponding td-->
- <td>
- <img src="bulletinImage.php?id=<php echo $id ?>">
- </td>
- </tr>
Expand|Select|Wrap|Line Numbers
- <?php
- $con = mysql_connect("localhost","root","");
- if(!$con)
- {
- die('Could not connect: ' . mysql_error());
- }
- mysql_select_db("ocean",$con);
- //This query is static, its here that i shall put the select query from the data selected on the previous page main.php
- $query = "SELECT outputMap FROM globalStructure WHERE id = 1";
- $result = mysql_query($query) or die('Error, query failed');
- //$result = mysql_query($_POST['ScreenResolution']) or die('Error, query failed');
- $content=mysql_result($result,0,"outputMap");
- //send pdf to requesting page
- header("Content-type: outputMap/jpg");
- echo $content;
- ?>
Thanking you.