• \n    \n    \n        

    \n            賬號:\n        <\/p>\n        

    \n            密碼:\n        <\/P>\n        

    \n            \n            \n        <\/p>\n    <\/form>\n<\/body>\n<\/html><\/pre>

    ? ? login.html ???? ????. ??? ??? ????? ?? ??? ?? ??<\/p>

    namespace app\\index\\controller;\nuse think\\Controller;\n\/\/繼承Controller\nclass Login extends Controller\n{\n    public function index(){\n        return view();\n    }\n\/\/    判斷登陸成功失敗的邏輯\n    public function check(){\n        $user=$_POST['username'];\n        $pwd=$_POST['password'];\n        if($user=='admin' && $pwd=='123'){\n\/\/            如果成功則跳到index\/index頁面\n            $this->success('登陸成功',url('\/index\/index'));\n        }else{\n            $this->error('登陸失敗');\n        }\n    }\n}<\/pre>

    System<\/p>

     \/**\n     * 操作成功跳轉(zhuǎn)的快捷方法\n     * @access protected\n     * @param mixed  $msg    提示信息\n     * @param string $url    跳轉(zhuǎn)的 URL 地址\n     * @param mixed  $data   返回的數(shù)據(jù)\n     * @param int    $wait   跳轉(zhuǎn)等待時間\n     * @param array  $header 發(fā)送的 Header 信息\n     * @return void\n     * @throws HttpResponseException\n     *\/\n    protected function success($msg = '', $url = null, $data = '', $wait = 3, array $header = [])\n    {}<\/pre>

    ???? ??? ??? ??: ??() ???? ?? ?? ?????? ?? ??, ?? ?? \/index\/index? ?????. ??? ??( ) ????? ?? ?????? ????<\/p>

    \"thinkphp??<\/p>

    ?? ?????? ?????. ???? ???? ???? ?????? ??? ?? ??? ???? ?? ? ???? ? ??? ?????? ???? ???<\/p>

    1. ??? ?????? ?? config.php? ???. ?? ? ?? ??? ? ? ????<\/p>

    \/\/ 默認(rèn)跳轉(zhuǎn)頁面對應(yīng)的模板文件\n    'dispatch_success_tmpl'  => THINK_PATH . 'tpl' . DS . 'dispatch_jump.tpl',    \/\/成功跳轉(zhuǎn)的界面\n    'dispatch_error_tmpl'    => THINK_PATH . 'tpl' . DS . 'dispatch_jump.tpl',    \/\/失敗跳轉(zhuǎn)的界面<\/pre>

    ?? ??? ?? ?? ?? ??? ??? ?????? dispatch_jump.tpl?? ? ? ????. thinkphptpldispatch_jump.tpl ??? ?? ?? ????<\/p>

    ? ?? ??? ??? ?????. ??? ?? ??? ???????<\/p>

    \n        \n            \n            

    :)<\/h1>\n            \n            \"thinkphp??\n            

    <\/p>\n            \n            \n            

    :(<\/h1>\n            \n            \"thinkphp??\n            

    <\/p>\n            \n        <\/pre>

    2. ?? ??? ???? ??? ?????? ?? ? ?? ? ??? ????. thinkphptpl ????, ??? ??.tpl ? ??? ?? tpl ??, config.php <\/p>

    \/\/原來指定的路徑\n\/\/ 默認(rèn)跳轉(zhuǎn)頁面對應(yīng)的模板文件\n    'dispatch_success_tmpl'  => THINK_PATH . 'tpl' . DS . 'dispatch_jump.tpl',\n    'dispatch_error_tmpl'    => THINK_PATH . 'tpl' . DS . 'dispatch_jump.tpl'\n\/\/修改為自定義的文件路徑\n     'dispatch_success_tmpl'  => THINK_PATH . 'tpl' . DS . 'success.tpl',\n     'dispatch_error_tmpl'    => THINK_PATH . 'tpl' . DS . 'error.tpl'<\/pre>

    bootstrap?? ?? ??? ??????. ???, ????? ? ?, ??? ??? ?????? <\/p>\n

    ?? ??: \"thinkPHP ??? ????<\/a>\"<\/p>"}

    国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

    ? PHP ????? ThinkPHP thinkphp?? ?? ???? ???? ??

    thinkphp?? ?? ???? ???? ??

    Dec 12, 2022 am 09:21 AM
    thinkphp

    ?? ???? ???? Thinkphp ??: 1. index/login ??? ? login.html ???? ????. 2. ? ??? ????? ????. 3. "??? ?? ??(){...}? ?? ??? ?????. " ?? ??; 4. "dispatch_jump.tpl" ??? ???. 5. "config.php"?? ?? ??? ?????.

    thinkphp?? ?? ???? ???? ??

    ? ????? ?? ??: Windows 7 ???, ThinkPHP ?? 5, Dell G3 ???.

    ThinkPHP5 ??? ??

    ??? ?? ??

    ?? ??? ?? ? ?? ??? ???? ??? ? ????

    1 index/login

    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="UTF-8">
        <title>登陸</title>
    </head>
    <body>
        <!--{:url(&#39;check&#39;)}  :提交到本頁面的控制器下的check方法-->
        <form action="{:url(&#39;check&#39;)}" method="post">
            <p>
                賬號:<input type="text" name="username" id="username">
            </p>
            <P>
                密碼:<input type="text" name="password" id="password">
            </P>
            <p>
                <input type="submit" value="提交">
                <input type="reset" value="重置">
            </p>
        </form>
    </body>
    </html>

    ? ? login.html ???? ????. ??? ??? ????? ?? ??? ?? ??

    namespace app\index\controller;
    use think\Controller;
    //繼承Controller
    class Login extends Controller
    {
        public function index(){
            return view();
        }
    //    判斷登陸成功失敗的邏輯
        public function check(){
            $user=$_POST[&#39;username&#39;];
            $pwd=$_POST[&#39;password&#39;];
            if($user==&#39;admin&#39; && $pwd==&#39;123&#39;){
    //            如果成功則跳到index/index頁面
                $this->success(&#39;登陸成功&#39;,url(&#39;/index/index&#39;));
            }else{
                $this->error(&#39;登陸失敗&#39;);
            }
        }
    }

    System

     /**
         * 操作成功跳轉(zhuǎn)的快捷方法
         * @access protected
         * @param mixed  $msg    提示信息
         * @param string $url    跳轉(zhuǎn)的 URL 地址
         * @param mixed  $data   返回的數(shù)據(jù)
         * @param int    $wait   跳轉(zhuǎn)等待時間
         * @param array  $header 發(fā)送的 Header 信息
         * @return void
         * @throws HttpResponseException
         */
        protected function success($msg = &#39;&#39;, $url = null, $data = &#39;&#39;, $wait = 3, array $header = [])
        {}

    ???? ??? ??? ??: ??() ???? ?? ?? ?????? ?? ??, ?? ?? /index/index? ?????. ??? ??( ) ????? ?? ?????? ????

    thinkphp?? ?? ???? ???? ??

    ?? ?????? ?????. ???? ???? ???? ?????? ??? ?? ??? ???? ?? ? ???? ? ??? ?????? ???? ???

    1. ??? ?????? ?? config.php? ???. ?? ? ?? ??? ? ? ????

    // 默認(rèn)跳轉(zhuǎn)頁面對應(yīng)的模板文件
        &#39;dispatch_success_tmpl&#39;  => THINK_PATH . &#39;tpl&#39; . DS . &#39;dispatch_jump.tpl&#39;,    //成功跳轉(zhuǎn)的界面
        &#39;dispatch_error_tmpl&#39;    => THINK_PATH . &#39;tpl&#39; . DS . &#39;dispatch_jump.tpl&#39;,    //失敗跳轉(zhuǎn)的界面

    ?? ??? ?? ?? ?? ??? ??? ?????? dispatch_jump.tpl?? ? ? ????. thinkphptpldispatch_jump.tpl ??? ?? ?? ????

    ? ?? ??? ??? ?????. ??? ?? ??? ???????

    <!--根據(jù)code來判斷顯示成功還是失敗,1代表成功,0代表失敗-->
            <?php switch ($code) {?>
                <?php case 1:?>
                <h1>:)</h1>
                <!--這行代碼是我自己在static下添加的一張成功的笑臉圖片,路徑是根據(jù)入口文件的位置來定義圖片的位置,入口文件和static是同一級目錄-->
                <img  src="/static/imghw/default1.png"  data-src="/static/xiao.jpg"  class="lazy"      style="max-width:90%" height="100px" alt="thinkphp?? ?? ???? ???? ??" >
                <p><?php echo(strip_tags($msg));?></p>
                <?php break;?>
                <?php case 0:?>
                <h1>:(</h1>
                <!--這行代碼是我自己在static下添加的一張失敗的哭臉圖片,路徑是根據(jù)入口文件的位置來定義圖片的位置,入口文件和static是同一級目錄-->
                <img  src="/static/imghw/default1.png"  data-src="/static/ku.jpg"  class="lazy"      style="max-width:90%" height="100px" alt="thinkphp?? ?? ???? ???? ??" >
                <p><?php echo(strip_tags($msg));?></p>
                <?php break;?>
            <?php } ?>

    2. ?? ??? ???? ??? ?????? ?? ? ?? ? ??? ????. thinkphptpl ????, ??? ??.tpl ? ??? ?? tpl ??, config.php

    //原來指定的路徑
    // 默認(rèn)跳轉(zhuǎn)頁面對應(yīng)的模板文件
        &#39;dispatch_success_tmpl&#39;  => THINK_PATH . &#39;tpl&#39; . DS . &#39;dispatch_jump.tpl&#39;,
        &#39;dispatch_error_tmpl&#39;    => THINK_PATH . &#39;tpl&#39; . DS . &#39;dispatch_jump.tpl&#39;
    //修改為自定義的文件路徑
         &#39;dispatch_success_tmpl&#39;  => THINK_PATH . &#39;tpl&#39; . DS . &#39;success.tpl&#39;,
         &#39;dispatch_error_tmpl&#39;    => THINK_PATH . &#39;tpl&#39; . DS . &#39;error.tpl&#39;

    bootstrap?? ?? ??? ??????. ???, ????? ? ?, ??? ??? ??????

    ?? ??: "thinkPHP ??? ????"

    ? ??? thinkphp?? ?? ???? ???? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

    ? ????? ??
    ? ?? ??? ????? ???? ??? ??????, ???? ?????? ????. ? ???? ?? ???? ?? ??? ?? ????. ???? ??? ???? ???? ??? ?? admin@php.cn?? ?????.

    ? AI ??

    Undresser.AI Undress

    Undresser.AI Undress

    ???? ?? ??? ??? ?? AI ?? ?

    AI Clothes Remover

    AI Clothes Remover

    ???? ?? ???? ??? AI ?????.

    Video Face Swap

    Video Face Swap

    ??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

    ???

    ??? ??

    ???++7.3.1

    ???++7.3.1

    ???? ?? ?? ?? ???

    SublimeText3 ??? ??

    SublimeText3 ??? ??

    ??? ??, ???? ?? ????.

    ???? 13.0.1 ???

    ???? 13.0.1 ???

    ??? PHP ?? ?? ??

    ???? CS6

    ???? CS6

    ??? ? ?? ??

    SublimeText3 Mac ??

    SublimeText3 Mac ??

    ? ??? ?? ?? ?????(SublimeText3)

    ???

    ??? ??

    ??? ????
    1601
    29
    PHP ????
    1502
    276
    ???
    thinkphp ????? ???? ?? thinkphp ????? ???? ?? Apr 09, 2024 pm 05:33 PM

    ThinkPHP ????? ????? ??? ?????: Composer? ????, ???? ????? ???? php bin/console? ????, ?? ???? ??? http://localhost:8000? ?????.

    thinkphp?? ?? ??? ????. thinkphp?? ?? ??? ????. Apr 09, 2024 pm 06:09 PM

    ThinkPHP?? ??? PHP ????? ??? ?? ??? ????. ??? ???? 3.2, 5.0, 5.1, 6.0? ????, ??? ??? ??? ???? ??? ??? ???? ? ?????. ?? ?? ??? ThinkPHP 6.0.16???. ??? ??? ? PHP ??, ?? ?? ?? ? ???? ??? ??????. ??? ??? ??? ???? ?? ?? ??? ???? ?? ????.

    thinkphp? ???? ?? thinkphp? ???? ?? Apr 09, 2024 pm 05:39 PM

    ThinkPHP Framework? ???? ???? ??: ThinkPHP Framework? ?? ????? ?????? ??? ???. ThinkPHP ?? ????? ???? ?? ???(?? ??)? ????. ?????? ?? ????? ?????. ? ??? ?????. ThinkPHP ??????? ??????. ThinkPHP ?????? URL? ???? ?????.

    laravel? thinkphp ? ?? ?? ? ???? laravel? thinkphp ? ?? ?? ? ???? Apr 09, 2024 pm 03:18 PM

    Laravel? ThinkPHP ?????? ?? ??: ThinkPHP? ????? ??? ? ??? ??? ?? Laravel?? ??? ????. Laravel? ? ????? ??? ??????? ?? ThinkPHP? ? ??? ? ????.

    thinkphp? ???? ?? thinkphp? ???? ?? Apr 09, 2024 pm 05:42 PM

    ThinkPHP ?? ??: PHP, Composer ? MySQL ??? ?????. Composer? ???? ????? ????. ThinkPHP ?????? ???? ?????. ?????? ??? ?????. ?????? ??? ?????. ??????? ???? http://localhost:8000? ?????.

    thinkphp ??? ????? thinkphp ??? ????? Apr 09, 2024 pm 05:24 PM

    ThinkPHP? ?? ????, ?? ???, ?? ?? ? ?????? ???? ?? ??? ?? ??? PHP ????????. ?? ?? ???? ??? ?? 10,000? ??? ??? ??? ? ??? JD.com, Ctrip? ?? ??? ? ??? ? ?????? ????? ?? ?? ?????? ?? ?????.

    ?? ??: API ??? ?? ThinkPHP ?????? ???? ?? ?? ??: API ??? ?? ThinkPHP ?????? ???? ?? Nov 22, 2023 pm 05:18 PM

    ?? ??: API ??? ?? ThinkPHP ?????? ???? ?? ???? ????? ????? API(?? ????? ?????)? ???? ?? ? ??? ????. API? ??? ??, ?? ?? ? ?? ??? ??? ? ??? ????? ??? ???? ?? ?? ??? ?????. ??? PHP ?? ?????? ThinkPHP ?????? ????? ?? ???? ???? ????.

    ?? ??: ThinkPHP ?????? ???? ??? ??? ???? ?? ?? ??: ThinkPHP ?????? ???? ??? ??? ???? ?? Nov 22, 2023 pm 12:01 PM

    "?? ??: ThinkPHP ?????? ???? ??? ??? ???? ??" ??? ??? ??? ???? ?? ? ?? ????? ?? ?? ?? ??? ??? ???? ??? ???? ?? ?? ??? ?? ? ??????. ??? ??? ??? ??? ????? ?? ???? ??? ???, ?? ??? ??, ??? ?? ?? ?? ??? ?? ??? ??? ???? ?? ??? ??? ???? ?? ?? ?????. PHP ???? ?? ???? ?? ?????? ThinkPHP ?????? ??? ??? ???? ? ?? ??? ??? ?????.

    See all articles