中国医患比:图片按钮给php传值的一个问题

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/19 07:45:08
这是我写的表单,将值传给set_order.php
<form action=set_order.php method=post>
<input type=image name=up src=images/up.png>
<input type=image name=down src=images/down.png>
<input type=image name=top src=images/top.png>
</form>

在set_order.php中,我写的是这样
if($up.x==true and $up.y==true)
{
称为代码1
}
if($down.x==true and $down.y==true)
{
代码2
}
if($top.x==true and $top.y==true)
{
代码三
}

执行结果是:不论点击up down 还是top三个中的哪一个,程序执行的都是“代码1”

不知道这是什么原因,盼望大家帮帮我

你还是用
<form action=set_order.php method=post>
<input type=image name=up src=images/up.png>
<a href="set_order.php?id=<?php echo $你要传递的值; ?><img src="images/down.png"> </a>
<a href="set_order.php?id=<?php echo $你要传递的值; ?><img src="images/top.png"></a>
</form>
传递吧,因为一个表单里只能有一个图像域提交
然后在set_order.php里作判断是哪个图片提交的

up.x 换成 up_x
试试