我想根据用户的选择将一个值添加到会话变量中。用户通过单击图像映射内的某些区域形状来进行选择。
这是我的代码。
<a class="selection_5M_platform"><img src="../../images/Selection/Windmillselection-platform5M-fullview.gif" usemap="#Windmillselection_Map5M_platform" alt="windmill_platform6M" name="windmill_platform6M">
<map class="map" name="Windmillselection_Map5M_platform">
<area shape="poly" coords="12,131,56,131,61,133,68,136,74,140,74,345,12,345" href="../submitreport.php" onClick="<?php $_POST['selectedreportlocation']="5M_PLATFORM_LADDERS" ?>" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('windmill_platform6M','','../../images/Selection/Windmillselection-platform5M-ladders.gif',1)" alt="ladders_platform5M">
<area shape="poly" coords="73,344,73,141,69,136,59,132,48,131,48,124,267,123,267,132,229,135,202,142,194,151,195,344" href="../submitreport.php" onClick="<?php $_SESSION['selectedreportlocation']="5M_PLATFORM_FOUNDATION" ?>" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('windmill_platform6M','','../../images/Selection/Windmillselection-platform5M-foundation.gif',1)" alt="foundation_platform5M">
<area shape="poly" coords="148,121,177,121,177,46,125,6,47,6,47,74,58,74,58,46,105,52,109,67,121,67,126,54,148,58" href="../submitreport.php" onClick="<?php $_SESSION['selectedreportlocation']="5M_PLATFORM_PALFINGER" ?>" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('windmill_platform6M','','../../images/Selection/Windmillselection-platform5M-palfinger.gif',1)" alt="palfinger_platform5M">
<area shape="poly" coords="49,123,49,92,149,92,149,121,177,121,177,91,187,62,271,60,268,90,268,123" href="../submitreport.php" onMouseOut="MM_swapImgRestore()" onClick="<?php $_SESSION['selectedreportlocation']="5M_PLATFORM_GUARDRAIL" ?>" onMouseOver="MM_swapImage('windmill_platform6M','','../../images/Selection/Windmillselection-platform5M-guardrail.gif',1)" alt="guardrail_platform5M">
</map>
</a>
这段代码的问题:它与你选择哪个无关,它总是将相同的值存储在会话变量中(最后一个“5M_PLATFORM_GUARDRAIL”)。
我究竟做错了什么?