前景提要
HDC调试需求开发(15万预算),能者速来!>>> addUser.php:<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body> <h2>添加用户</h2> <form action="doAction.php?act=addUser" method="post"> <table border="1" cellspacing="0" cellpadding="0" bgcolor="#ABCDEF" width="50%"> <tr> <td>用户名</td> <td><input type="text" name="user_name" id="" placeholder="请输入合法用户名" required="required"/></td> </tr> <tr> <td>密码</td> <td><input type="password" name="pass_word" id="" placeholder="请输入密码" required="required"/></td> </tr> <tr> <td>年龄</td> <td><input type="number" name="age" id="" min="1" max="150" placeholder="请输入年龄" required="required"/></td> </tr> <tr> <td colspan="2"><input type="submit" value="添加用户"/></td> </tr> </table> </form> </body> </html>
doAction.php:
<?php header("content-type:text/html;charset:utf-8"); $con = new mysqli('localhost','root','','test'); if($con->connect_errno){ die($con->connect_error); } $con->set_charset('utf8'); $username=$_POST['user_name']; $username=$con->escape_string($username); $password=$_POST['pass_word']; $age=$_POST['age']; $act=$_GET['act']; var_dump($_POST); var_dump($_GET);
奇怪的是:在Windows是上运行正常,反而在Ubuntu没用。都是最新的XAMPP
Chrome抓包可以看见
post就是取不到值啊,求解