有以下代码:
<script language="javascript" type="text/javascript">
function SetImageName(strName)
{
document.getElementById("ImageName").value = strName;
}
</script>
<form>
<div id="slideshow">
<div id="Container">
<div id="Images">
<img src="images/image1.jpg" name="image1.jpg" onclick="SetImageName(this.name)"/>
<img src="images/image2.jpg" name="image2.jpg" onclick="SetImageName(this.name)"/>
<img src="images/image3.jpg" name="image3.jpg" onclick="SetImageName(this.name)"/>
<img src="images/image4.jpg" name="image4.jpg" onclick="SetImageName(this.name)"/>
<img src="images/image5.jpg" name="image5.jpg" onclick="SetImageName(this.name)"/>
<div id="slideEnd"></div>
</div>
</div>
</div>
<input type="hidden" value="" id="ImageName" name="ImageName"/></form>
用户可以从列表中选择图像。想要预览用户选择的图像。喜欢
You are selected image is
<?
$image = $_POST["ImageName"];
echo ('<img src="'.$image.'" />');
?>