将罗盘点传递给 PHP
我使用绘画创建了一个圆圈 (Circle.jpg),并在其周围放置了 4 个数字,分别代表北 (360) 东 (90) 西 (270) 和南 (180)。我试图将我点击的数字传递给 PHP。无法让它工作,或者我能找到任何接近我想做的事情吗?打开 HTML 链接可以工作,但不是我需要的。当在选择周围单击时,下面的代码确实会产生一个圆圈。以下是 East(90) 的代码。我也尝试过添加 value="90",但没有什么区别。预先感谢您的帮助。
<body>
<body bgcolor="#0080C0">
<img usemap="#shapes" src="images/Circle.jpg" alt="">
<map name="shapes" id="shapes">
<area shape="circle" coords="158,76,10" href="#" bearing="90" alt="90" </area>
<?php
$StateOrBearing = $_POST['bearing'];
echo $StateOrBearing;
?>
I created a circle using paint (Circle.jpg) and placed 4 numbers for now around it representing North (360) East(90) West(270) and South(180). I am trying to pass to PHP what number I click on. Can not get it to work or can I find anything close to what I am trying to do. Opening an HTML link works but not what I need. Below code does produce a circle when clicked around selection. Below is code just for East(90). I have tried also adding value="90", does not make a difference. Thanks in advance for help.
<body>
<body bgcolor="#0080C0">
<img usemap="#shapes" src="images/Circle.jpg" alt="">
<map name="shapes" id="shapes">
<area shape="circle" coords="158,76,10" href="#" bearing="90" alt="90" </area>
<?php
$StateOrBearing = $_POST['bearing'];
echo $StateOrBearing;
?>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您只需使用适当的参数信息更新 HREF。
如果您需要非常精细的粒度,您还可以在 Javascript 中传递像素坐标或使用现已过时的服务器端图像映射,但这是一种不同的蠕虫。
You just need to update your HREFs with appropriate parameter information.
If you need very fine granularity, you could also pass pixel coordinates in Javascript or use the now-antiquated server side image map, but that's a different can of worms.