尊龙凯时人生就是搏

thinkphp5ÅжÏÊÇ·ñÊÇpostÇëÇó

ÔÚʹÓÃthinkphp5¾ÙÐÐweb¿ª·¢Ê±£¬ÅжÏÄ¿½ñÇëÇóÊÇ·ñΪpostÇëÇóÊÇÒ»ÖÖ³£¼ûµÄÐèÇó¡£ÓÉÓÚpostÇëÇóÓëgetÇëÇó²î±ð£¬postÇëÇóͨ³£ÓÃÓÚÏòЧÀÍÆ÷Ìá½»Êý¾Ý£¬¶øgetÇëÇóͨ³£ÓÃÓÚ´ÓЧÀÍÆ÷»ñÈ¡Êý¾Ý¡£Òò´Ë£¬ÔÚÇø·ÖÇëÇóÀàÐÍʱ£¬»á¶Ô¶ÔÓ¦µÄÇëÇó×ö³ö²î±ðµÄ´¦Àí¡£

ÔÚThinkPHP5ÖУ¬ÅжÏÄ¿½ñµÄÇëÇóÊÇ·ñΪPOSTÇëÇóºÜÊǼòÆÓ¡£ÏÂÃæÏÈÈÝÈýÖÖÒªÁìÀ´ÅжÏÊÇ·ñΪPOSTÇëÇó¡£

ÒªÁìÒ»£ºÊ¹ÓÃrequest¹¤¾ß

ÔÚThinkPHP5ÖУ¬¿ÉÒÔͨ¹ýrequest¹¤¾ß»ñÈ¡Ä¿½ñÇëÇóµÄÏà¹ØÐÅÏ¢¡£Í¨¹ýÅжÏÄ¿½ñÇëÇóµÄ·½·¨ÊÇ·ñΪPOST£¬¼´¿ÉÅжÏÄ¿½ñÇëÇóÊÇ·ñΪPOSTÇëÇ󣬴úÂëÈçÏ£º

use thinkRequest;

$request = Request::instance();
if ($request->isPost()) {
    // ´¦ÀíPOSTÇëÇóµÄÂß¼­´úÂë
}

µÇ¼ºó¸´ÖÆ

ÔÚÉÏÃæµÄ´úÂëÖУ¬Ê×ÏÈʵÀý»¯ÁËRequestÀ࣬²¢»ñÈ¡Ä¿½ñµÄÇëÇóÐÅÏ¢¡£½Ó×ÅŲÓÃRequest¹¤¾ßµÄisPost()ÒªÁìÀ´ÅжÏÄ¿½ñÇëÇóµÄ·½·¨ÊÇ·ñΪPOST¡£ÈôÊÇÊÇPOSTÇëÇó£¬ÔòÖ´ÐÐÏà¹ØµÄÓªÒµÂß¼­¡£

ÒªÁì¶þ£ºÊ¹ÓÃinput¹¤¾ß

ÔÚThinkPHP5µÄ¿ØÖÆÆ÷ÖУ¬¿ÉÒÔͨ¹ýinput¹¤¾ß»ñÈ¡Ä¿½ñÇëÇóµÄÏà¹ØÐÅÏ¢¡£Í¨¹ýÅжÏÄ¿½ñÇëÇóµÄ·½·¨ÊÇ·ñΪPOST£¬¼´¿ÉÅжÏÄ¿½ñÇëÇóÊÇ·ñΪPOSTÇëÇ󣬴úÂëÈçÏ£º

Á¬Ã¦Ñ§Ï°¡°PHPÃâ·ÑѧϰÌõ¼Ç£¨ÉîÈ룩¡±£»

use thinkController;

class Index extends Controller
{
    public function index()
    {
        $request = $this->request->param();
        if ($this->request->isPost()) {
            // ´¦ÀíPOSTÇëÇóµÄÂß¼­´úÂë
        }
    }
}

µÇ¼ºó¸´ÖÆ

ÔÚÉÏÃæµÄ´úÂëÖУ¬input¹¤¾ßÒ²±»ÓÃÀ´»ñÈ¡Ä¿½ñÇëÇóµÄÐÅÏ¢¡£Í¨¹ýÇëÇ󹤾ߵÄisPost()ÒªÁ죬Ҳ¿ÉÒÔÅжÏÄ¿½ñÇëÇóÊÇPOSTÇëÇóÕÕ¾ÉÆäËûÀàÐ͵ÄÇëÇó¡£

ÒªÁìÈý£ºÊ¹ÓÃrequestÖúÊÖº¯Êý

ÔÚThinkPHP5ÖУ¬»¹ÌṩÁËÒ»ÖÖÔ½·¢ÇáÓ¯µÄÒªÁìÀ´ÅжÏÄ¿½ñÇëÇóÊÇ·ñΪPOSTÇëÇ󡣿ÉÒÔʹÓÃrequestÖúÊÖº¯Êý£¬´úÂëÈçÏ£º

if (request()->isPost()) {
    // ´¦ÀíPOSTÇëÇóµÄÂß¼­´úÂë
}

µÇ¼ºó¸´ÖÆ

ÔÚÉÏÃæµÄ´úÂëÖУ¬Í¨¹ýŲÓÃrequest()ÒªÁì»ñÈ¡Ä¿½ñÇëÇóµÄÐÅÏ¢£¬²¢Ö±½ÓʹÓÃrequest()º¯ÊýµÄisPost()ÒªÁìÀ´ÅжÏÄ¿½ñÇëÇóÊÇ·ñΪPOSTÇëÇó¡£

ÎÞÂÛÊÇʹÓÃrequest¹¤¾ß¡¢input¹¤¾ßÕÕ¾ÉrequestÖúÊÖº¯Êý£¬¶¼¿ÉÒÔºÜÈÝÒ×µØÅжÏÄ¿½ñÇëÇóÊÇ·ñΪPOSTÇëÇó¡£ÔÚ¿ª·¢Àú³ÌÖУ¬¿ÉÒÔƾ֤ÏêϸÐèÇóÑ¡ÔñʹÓòî±ðµÄ·½·¨¡£

ÒÔÉϾÍÊÇthinkphp5ÅжÏÊÇ·ñÊÇpostÇëÇóµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí£¬°æȨÕùÒéÓë±¾Õ¾Î޹أ¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í尊龙凯时人生就是搏ÂËÓÍ»úÍø¹Ù·½Ì¬¶È£¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ£¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢£¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢£¬ÇëÄúÁ¬Ã¦ÁªÏµ尊龙凯时人生就是搏ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ尊龙凯时人生就是搏

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎ壬9:30-18:30£¬½ÚãåÈÕÐÝÏ¢

QR code
sitemap¡¢ÍøÕ¾µØͼ