Ok what I want is a button that retrieves an image from my server and then displays it on one of my websites pages..
Basically what I want is a way to just push a button that will display a War Alert image on my website
Button to retrieve and display an image?
Moderator: General Moderators
Re: Button to retrieve and display an image?
One way is to use a form and a type=button or type=submit and when the form is submitted you display the image.
if(isset($_POST['button_var'])) echo "<img ...>":
if(isset($_POST['button_var'])) echo "<img ...>":
Re: Button to retrieve and display an image?
papa wrote:One way is to use a form and a type=button or type=submit and when the form is submitted you display the image.
if(isset($_POST['button_var'])) echo "<img ...>":
this would be helpful IF I knew how to write code...
I need the code already written though then I can just make the changes I need to make to fit it into my page..
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: Button to retrieve and display an image?
There a few ways you could do this. One very simple way would be to create a hidden field with the path and image name (including file type jpg or gif etc...), then create a submit button:
Does that make sense?
Code: Select all
//This is the form
<form method="post">//this form will POST to itself
<input type="hidden" name="strImage" value="path/image.jpg" />
<input type="submit" name="submitImage" value="Show Image" />
</form>
Code: Select all
//this is the "get image" part
if(isset($_POST['submitImage']))
{
$strImage=$_POST['strImage'];
}
echo'<img src="' . $strImage .'" />';