为什么小弟我的表单只能提交一次

WBOY
Release: 2016-06-13 13:28:35
Original
982 people have browsed it

为什么我的表单只能提交一次
我这个表单只能提交一次,我重新选择一个时间,第二次点击提交就没反映了

 


 

  Select date

   
   
 
 
 

  if(isset($_REQUEST['date']))
  {
  //$curd=date("Y-m-d");
  $curd=$_REQUEST['date'];
  $json_array1=null;
  $array1=null;
  $subtotal=0;
  $database=new db("localhost","root","19801010_zxy","zxy_hms_db");  
  $result=$database->query("","income","date='$curd'");  
  if($result)
  {
  while($row=mysql_fetch_array($result))
  {
  $subtotal=$row['rent'];
  }
   
  $array1=array("$curd",$subtotal);
  $json_array1 = json_encode($array1);
  }
   
  echo "";
  echo "";
  echo "";
  echo "";
  echo "
date Sales
";
   
  echo "
";
  echo "
";
   

   
  }

?>

------解决方案--------------------
单凭这点代码是不可能出现你说的问题的。除非你的代码还没贴完。
------解决方案--------------------
把php代码放到该页代码的顶端,即script之前
------解决方案--------------------
因为后端代码执行完之后才轮到前端代码执行
------解决方案--------------------
探讨

因为后端代码执行完之后才轮到前端代码执行

------解决方案--------------------
建议你用Firefox的debug看看网络之间的传输
第一次点击提交按钮后的网络链接:
http://localhost/report/dailysale.php?date=……
那么在你的dailysale.php页面就会有if(isset($_REQUEST['date']))的操作被执行。
而再次刷新时的页面链接就变为:
http://localhost/report/dailysale.php
因为没有按钮提交时所获取的表单内容
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!