为了账号安全,请及时绑定邮箱和手机立即绑定

$_POST失效,返回空数组

提交出代码:

<?php
   require_once ("../config.php");

   //把传递过来的信息入库
  /* print_r($_POST);*/
   /*echo $name;*/
   echo file_get_contents("php://input");
   $a=$_POST['bookName'];
   echo $a;

html代码

<form role="form" id="form1" name="form1" method="POST" action="book.add.handle.php">
   <div class="form-group">
       <label for="id">id:</label><input type="text" class="coomm-id" name="id"/>
   </div>
   <div class="form-group">
       <label for="bookName">书名:</label><input type="text" class="coomm-id" name="bookName"/>
   </div>
   <div class="form-group">
       <label for="bookType">书本类型:</label><input type="text" class="coomm-id" name="bookType"/>
   </div>
   <div class="form-group">
       <label for="bookAuthor">作者:</label><input type="text" class="coomm-id" name="bookAuthor"/>
   </div>
   <div class="form-group">
       <label for="price">价钱:</label><input type="text" class="coomm-id" name="price"/>
   </div>
   <div class="form-group">
       <label for="total">总数:</label><input type="text" class="coomm-id" name="total"/>
   </div>
   <div class="btn-wrap">
       <input type="submit" class="btn btn-primary" value="提交"></input>
       <button class="btn btn-info" type="button">重置</button>
   </div>
</form>

这是为什么呢?

正在回答

3 回答

我也。。。

0 回复 有任何疑惑可以回复我~

我也是这种情况

http://img1.sycdn.imooc.com//590202be0001b6bc10120286.jpg

不知道为什么是空的

0 回复 有任何疑惑可以回复我~

失效?你在书名那个text中输入了么

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
PHP与MySQL关系大揭秘
  • 参与学习       72509    人
  • 解答问题       978    个

让我们一起走上探秘之旅,找寻php和mysql恋爱的真谛

进入课程

$_POST失效,返回空数组

我要回答 关注问题
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号