Home  >  Q&A  >  body text

The verification rule keeps popping up that the user name is empty?


$status = 0;

        $result = '';

          $data = $request->param();

                             

##                                                                                                                                 ’ s ’ s ’ s ‐ to 'name|username'=>'require',

#                                                                                                                                                                                                                               ‐‐‐‐‐‐‐‐‐‐‐‐‐ $data, $rule);

return ['status'=>$status, 'message'=>$result, 'data'=>$data];

brother_waterbrother_water2595 days ago1524

reply all(4)I'll reply

  • Sarah

    Sarah2017-08-31 15:24:18

    I watched the video from the beginning today and checked step by step. It turned out that there was a mistake here

    $rule = [
    'username|username' => 'require',
    'password|password' => 'require ',
    'verify|Verification code' => 'require|captcha'
    ];

    The template I downloaded is here

    <input id="" name="username" type="text" placeholder=" Account" class="input-text size-L">

    The name attribute here is 'username', and the attribute value in the teacher's template is 'name'. After changing it, there will be no other problems

    reply
    1
  • 至尊宝

    至尊宝2017-08-19 14:35:06

    There are many problems with the courseware in this section

    There is nothing in constructing the query conditions and it is still in a place where the verification code cannot be empty

    reply
    0
  • ringa_lee

    ringa_lee2017-08-16 13:35:56

    The value of the username was not received. Can you dump the received post data?

    reply
    1
  • 至尊宝

    至尊宝2017-08-16 10:57:15

    This is the same problem

    reply
    0
  • Sarah

    I want to ask if it has been solved? This is also the problem

    Sarah · 2017-08-30 17:27:26
  • Cancelreply