This was a quick one I came up with, it works in firefox so far.
I hope this helps!!
test1.php
PHP Code:
<?php
$img1 = "image1.jpg";
$img2 = "image2.jpg";
$img3 = "image3.jpg";
$i = 1;
?>
<html>
<body>
<form action="test2.php" method="post" name="myform<?=$i++?>">
<input type="hidden" value="<?=$img1?>" name="img" id="img">
<a href="#" onclick="document.forms['myform1'].submit()"><img src="<?=$img1?>"></a>
</form>
<form action="test2.php" method="post" name="myform<?=$i++?>">
<input type="hidden" value="<?=$img2?>" name="img" id="img">
<a href="#" onclick="document.forms['myform2'].submit()"><img src="<?=$img2?>"></a>
</form>
<form action="test2.php" method="post" name="myform<?=$i++?>">
<input type="hidden" value="<?=$img3?>" name="img" id="img">
<a href="#" onclick="document.forms['myform3'].submit()"><img src="<?=$img3?>"></a>
</form>
</body>
</html>
test2.php
PHP Code:
<?php
$img = $_POST['img'];
?>
<html>
<body>
<center>
<img src="<?=$img?>">
</center>
</body>
</html>
Edit: if its not working try changing <?=$img?> to <?php echo $img?>
Bookmarks