0

別のphpページに値を渡すために次のコードを試しましたが、何も得られません。

ファイル名:Send.html

<form id="form1" action="get.php" method="get">
<input name="search_name" type="text" id="search_name" size="20.5" height="45" border="#770074" >   
<select name="mydropdown" width="230" STYLE="width: 180px" size="0" "height: 200px">
<option value="All">All Categories</option>
<option value="Childrens Clothing">Childrens Clothing</option>
</select>
<img src="../img/search.jpg" width="70" height="45" border="0" align="left" usemap="#Map">
</form>

<map name="Map">
<area shape="poly" coords="5,35" href="#">
<area shape="rect" coords="-5,8,140,45" href="get.php">
</map>

ファイル名:get.php

<?php
$sname=$_GET['search_name'];
$cname=$_GET['mydropdown'];
echo $sname."<br>".$cname;
?>
4

3 に答える 3

0

追加する前に</form>、適切な送信ボタンを追加します。Send.html<input type="submit" value="Submit" />

編集 画像を使用する場合は、次の操作を実行できます。

<button type="submit"><img src="..." /></button>
于 2012-07-23T18:41:19.177 に答える
0
<img onclick="document.getElementById('form1').submit();" src="../img/search.jpg" width="70" height="45" border="0" align="left" usemap="#Map">
于 2012-07-23T18:43:09.680 に答える
0
<area shape="rect" coords="-5,8,140,45" onclick="document.form1.submit();">

送信ボタンとして画像上の特定の領域のみが必要だと思うので、これはwebartoの回答を少し編集したものです。

于 2012-07-23T18:51:16.023 に答える