php form表单相关问题
php代码如下:
Price:
show_by_Price.php关键处理代码如下:
if ($_GET[categories]=='pleaseChoose'){
if ($_GET[price]=='Please_Choose'){
//$result_price=null;
echo Please_choose ;
}
else {
if ($_GET[price]=='hight'){
echo p_H ;
$result_price = mysql_query("SELECT * FROM Product where Price>2000");
}
elseif ($_GET[price]=='middle'){
echo p_M ;
$result_price = mysql_query("SELECT * FROM Product where Price1000");
}
else{
echo p_L ;
$result_price = mysql_query("SELECT * FROM Product where Price }
}
}
else
{
if ($_GET[price]=='Please_Choose'){
echo C_P ;
$result_price = mysql_query("SELECT * FROM Product where Category='$_GET[categories]'");
}
else{
if ($_GET[price]=='hight'){echo C_H;
$result_price = mysql_query("SELECT * FROM Product where Price>2000 and Category='$_GET[categories]'");
}
elseif ($_GET[price]=='middle'){echo C_M;
$result_price = mysql_query("SELECT * FROM Product where (Price1000 )and Category='$_GET[categories]'");
}
else{echo C_L;
$result_price = mysql_query("SELECT * FROM Product where Price }
}
}
为什么两个框都选择的是Please Choose的时候 ,执行的是echo p_L ;
$result_price = mysql_query("SELECT * FROM Product where Price而不是echo Please_choose ;
求高手指点
------解决方案--------------------当一个表单提交时,另一个表单的值是未设置状态,而不是你想的等于pleaseChoose,所以,你的后台逻辑判断有误,你再好好看看。
------解决方案--------------------都跟你说啦。放入一个form当中去,事情就好办多了。