php form表单相关有关问题

WBOY
Release: 2016-06-13 13:18:02
Original
922 people have browsed it

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当中去,事情就好办多了。
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template