I was studying "The latest ThinkPHP 5.1 world premiere video tutorial (60 days to become a PHP expert online ** class)" by teacher Peter.zhu
, in section "10-3 Preliminary Implementation of User Registration Function", why can't my ajax submission data be passed to the controller?
register.html code is:
<div class="form-group">
<label for="inputEmail4" class="col-sm-2 control-label">密码:</label>
<div class="col-sm-10">
<input type="password" name="password" class="form-control" id="inputEmail4"
placeholder="Password">
## url: "{:url('insert')}",
echo "<script type='text/javascript'>alert('insert was executed');</script>";
// echo "dfsdfsdf";
if(Request::isAjax()){
// Verify data
// $this->error("Request type error",'register');
$ data = Request::post();//Get the data to be verified
$rule = 'app\common\validate\User';//Customized