Home >Backend Development >PHP Tutorial >数据库查出的列表$_POST提交没有数据解决思路

数据库查出的列表$_POST提交没有数据解决思路

WBOY
WBOYOriginal
2016-06-13 12:10:36723browse

数据库查出的列表$_POST提交没有数据
都说在实际的案例中才能学到东西,这句话不假。针对移动设备开发的,这不又遇了问题。$_POST提交时从数据库查出的列表提交不出数据。很奇怪,求各位大侠伸出援手,谢谢!!

<H2>品牌查询</h2> <br /><br /><form action="index4.php" method="post">  <br /><fieldset><br /><legend>输入查询条件:</legend>        <br />       <p align = "center"> <select name = "Sexual"><br />         <option value="all">所有品牌</option>                  <br />        <?php<br />         $sexual_result = mssql_query("select sexualid,sexualdesc from basesexual where stopflag='0'",$conn);<br />         $sexual_num = mssql_num_rows($sexual_result);<br />         $sexual_row = mssql_fetch_array($sexual_result);<br />         for($m=1;$m<=$sexual_num;$m++){<br />         ?><br />          <option value = "<?=$sexual_row[1]?>"><?=$sexual_row[1]?></option><br />        <?php<br />          $sexual_row = mssql_fetch_array($sexual_result);<br />         }<br />         ?>               <br />        </select><br />               <br />        <select name = "Branch">        <br />        <option value = "all">所有门店</option><br />		<?php<br />         $branch_result = mssql_query("select branchid,branchdesc from basebranch where type='1' and stopflag='0'",$conn);<br />         $branch_num = mssql_num_rows($branch_result);<br />         $branch_row = mssql_fetch_array($branch_result);<br />         for($m=1;$m<=$branch_num;$m++){<br />         ?><br />          <option value="<?=$branch_row[1]?>"><?=$branch_row[1]?></option><br />        <?php<br />          $branch_row = mssql_fetch_array($branch_result);<br />         }<br />         ?>        <br />		</select> <br />        <select name="Money"><br />	    <option>销售类型</option><br />		<option value="sale">销售</option><br />	    <option value="stock">库存</option><br />	    </select><p><br />        <p align="center">时间:<input type="text" name="startdate" value=<?php echo date('Ymd',strtotime('-1 day'));?>  size ='10' /><br />		至<input type="text" name="enddate" value=<?php echo date('Ymd',strtotime('-0 day')); ?> size='10' /></p>	<br />        <p align="center"><input type="submit" name="submit" value="确认" /></p><br /></fieldset>		<br /></form><br /><br /><?php<br />mssql_close($conn);<br />?> 



------解决思路----------------------
在 index4.php 中 print_r($_POST);

在你的表单页 查看网页源代码 看看有没有问题
------解决思路----------------------
那你 index4.php 是怎么写的?
都能 print_r($_POST); 出内容,怎么说是没数据呢?
------解决思路----------------------
$sexual = $_POST['Sexual'];
$branch = $_POST['Branch'];
$money = $_POST['Money'];
$startdate = $_POST['startdate'];
$enddate = $_POST['enddate'];

php 的变量是区分大小写的,当然关联键也是区分大小写的

$a = 1;
$A = 2;
$r['A'] = 3;
$r['a'] = 4;

------解决思路----------------------
大小写!!!!!!
------解决思路----------------------
是因为大小写问题

Statement:
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
Previous article:表单$_post[]的有关问题Next article:这里怎么理解呢