ユーザーの選択に応じて、セッション変数に値を追加したいと思います。ユーザーは、イメージ マップ内のいくつかのエリア シェイプ内をクリックして、選択を行います。
これは私が持っているコードです。
<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」) には常に同じ値が格納されます。
私は何を間違っていますか?