I want to create a button on a php pafe like a form now after pressing this button i should load an image. Now the I have done this. when the image is appearing it's on the other page than where the button was. I want to have the button on the same page. Left hand side i have a set of buttons and pressing each button should load image on the right side of the same page. I should be able to see the button and image both. Please help me how can I achieve this. Is it possible using only php. ?? Thanks for any help.
<?php
if(isset($_POST['submit']))
{
$imagepath="shirt7.jpg";
$image=imagecreatefromjpeg($imagepath);
header('Content-Type: image/jpeg');
imagejpeg($image);
}
?>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<input type="submit" name="submit" value="Submit Form"><br>
</form>