<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                ## 請求和響應 可以通過Request對象完成全局輸入變量的檢測,獲取和安全過濾,支持包括 $_GET $POST ,$_PEQUEST ,$_SERVER $_SESSION ,$_COOKIE ,$_ENV等變量,以及文件上傳信息。 ## 主要常用的為 | 方法 | 描述 | | --- | --- | | param | 獲取當前請求的變量 | | session | 獲取$_SESSION變量 | | cookie | 獲取$_COOKIE變量 | | file | 獲取$_FILES變量 | ## 用助手函數接收以上方法的值 ## 第一種:$request->param('參數') ## ##第二種: request()->param('參數'') ## ## 第三種:input('參數''); 一般用input比較方便, 想提高性能用 $request->param('參數') 第一種:代碼案例: ~~~ <?php namespace app\index\controller; use think\config; use think\Env; use think\Request; class Index { public function index(Request $request) { return "hallo worid".$request->param('id'); } } ~~~ 第二種:代碼案例: ~~~ <?php namespace app\index\controller; use think\config; use think\Env; use think\Request; class Index { public function index() { return "hallo worid".request()->param('id'); } } ~~~ 第三種代碼案例: ~~~ <?php namespace app\index\controller; use think\config; use think\Env; use think\Request; class Index { public function index() { return "hallo worid".input('id');; } } ~~~ ## 排除某個字段 語法: $request->except('字段') ## 只獲取某字段 語法: $request->only('字段') ## 過濾HTML標簽語法: $request->param('字段',' ','htmlspecialchars') //過濾掉HTML標簽 或者字段可以為空 $request->param(' ',' ','htmlspecialchars') //過濾掉HTML標簽 (這樣可以接受非指定的參數了可以GET與POST共用) ![](https://img.kancloud.cn/47/66/4766bfabc4f443f848610b929b321be6_830x56.png) ## 排除過濾字段代碼案例: ~~~ <?php namespace app\index\controller; use think\config; use think\Env; use think\Request; class Index { public function index(){ return "hallo worid".input('id'); } public function getpost(Request $request){ dump($request->except('ddd') ); //除了ddd字段以外都接受 dump($request->only('id')); //只獲取某一個字段 dump( $request->param('id','','strip_tags,md5')); //過濾掉HTML5標簽并添加MD5值 } } ~~~ ## 全局過濾方法 在config.php文件中設置 'default_filter'=>'htmlspecialchars' ![](https://img.kancloud.cn/23/e2/23e248113d54fc3fec37828bbbbcc629_1108x374.png)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看