久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      如何解決php獲取不到form數(shù)據(jù)

      如何解決php獲取不到form數(shù)據(jù)

      如何解決php獲取不到form數(shù)據(jù)?

      問題解決 修改php.ini配置

      找到php.ini配置文件,查找enable_post_data_reading變量,修改為打開狀態(tài),注釋掉句前分好

      ; Whether PHP will read the POST data. ; This option is enabled by default. ; Most likely, you won't want to disable this option globally. It causes $_POST ; and $_FILES to always be empty; the only way you will be able to read the ; POST data will be through the php://input stream wrapper. This can be useful ; to proxy requests or to process the POST data in a memory efficient fashion. ; http://php.net/enable-post-data-reading enable_post_data_reading = On    //大約656行,修改此條

      修改配置后,發(fā)現(xiàn)還是不行,繼續(xù)查閱資料。

      獲取非表單數(shù)據(jù)

      搜集資料之后,發(fā)現(xiàn)vue-axios向后端post的是非表單數(shù)據(jù)(Ajax不同),在獲取非表單數(shù)據(jù)時需要用php://input

      $raw = file_get_contents('php://input');//獲取非表單數(shù)據(jù)echo $raw;//輸出結(jié)果 PS:post時前端請求頭要設(shè)置為 headers: {    "Content-type": "application/json; charset=utf-8"}

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號