×ðÁú¿­Ê±¹ÙÍøµÇ¼

Ïê½âthinkphpÊÇ·ñ¿ÉÒÔÎüÊÕGET²ÎÊý

thinkphpÊÇÒ»¿î»ùÓÚphpÓïÑԵĿªÔ´webÓ¦Óÿò¼Ü£¬ËüÌṩÁËÇ¿Ê¢µÄmvc¼Ü¹¹£¬¸»ºñµÄ¹¦Ð§Ä£¿éºÍÇ¿Ê¢µÄÀ©Õ¹ÐÔ¡£ÔÚ¿ª·¢webÓ¦ÓÃÀú³ÌÖУ¬¾­³£ÐèÒªÎüÊÕget»òpost²ÎÊý£¬ÄÇôthinkphpÊÇ·ñ¿ÉÒÔÎüÊÕget²ÎÊýÄØ£¿±¾ÎĽ«Ïêϸ½â´ðÕâ¸öÎÊÌâ¡£

Ê×ÏÈ£¬ÎÒÃÇÐèÒªÃ÷È·Ò»ÏÂGETÓëPOSTÇëÇóµÄÇø±ð¡£GETÇëÇóÊÇͨ¹ýURLת´ï²ÎÊý£¬²ÎÊýÐÅÏ¢¿ÉÒÔÖ±½Ó̻¶ÔڵصãÀ¸ÖУ¬¶øPOSTÇëÇóÔòÊÇͨ¹ýHTTP±¨ÎÄת´ï²ÎÊý£¬²ÎÊýÐÅÏ¢Ôò±»°üÀ¨ÔÚ±¨ÎĵÄÖ÷Ì岿·Ö£¬²»»áÖ±½Ó̻¶ÔڵصãÀ¸ÖС£

ÔÚthinkphp¿ò¼ÜÖУ¬ÎüÊÕGET²ÎÊýºÜÊǼòÆÓ£¬ÎÒÃÇ¿ÉÒÔͨ¹ýÖ±½ÓŲÓÃRequest¹¤¾ßµÄgetÒªÁìÀ´»ñÈ¡Ö¸¶¨²ÎÊýÖµ¡£ÀýÈ磺

$value = Request::get('param_name');

µÇ¼ºó¸´ÖÆ

ÆäÖУ¬param_nameΪÎÒÃÇÖ¸¶¨µÄ²ÎÊýÃû¡£

±ðµÄ£¬»¹¿ÉÒÔͨ¹ýŲÓÃinputÒªÁìͬʱ»ñÈ¡POSTºÍGET²ÎÊý¡£ÀýÈ磺

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

$value = Request::input('param_name');

µÇ¼ºó¸´ÖÆ

´Ëʱ£¬ÈôÊÇͬʱ±£´æͬÃûµÄGETºÍPOST²ÎÊý£¬»áÓÅÏÈ»ñÈ¡POST²ÎÊý£¬ÈôÊDz»±£´æPOST²ÎÊý£¬Ôò»ñÈ¡GET²ÎÊý¡£

³ý´ËÖ®Í⣬»¹¿ÉÒÔͨ¹ýRequest¹¤¾ßµÄparamÒªÁìÀ´»ñÈ¡²ÎÊý¡£ÀýÈ磺

$value = Request::param('param_name');

µÇ¼ºó¸´ÖÆ

´ËÒªÁì¿ÉÒÔͬʱ»ñÈ¡POSTºÍGET²ÎÊý£¬ÓëinputÒªÁìÀàËÆ¡£µ«ÓëinputÒªÁì²î±ðµÄÊÇ£¬paramÒªÁ컹¿ÉÒÔÎüÊÕÒ»¸öĬÈÏÖµ×÷Ϊ²ÎÊý£¬µ±Ö¸¶¨²ÎÊý²»±£´æʱ£¬½«·µ»ØĬÈÏÖµ¡£ÀýÈ磺

$value = Request::param('param_name', 'default_value');

µÇ¼ºó¸´ÖÆ

ÈôÊÇÖ¸¶¨²ÎÊý²»±£´æ£¬Ôò·µ»Ødefault_value×÷ΪĬÈÏÖµ¡£

ÖµµÃ×¢ÖصÄÊÇ£¬ÓÉÓÚGETÇëÇóµÄ²ÎÊýÊÇͨ¹ýURLת´ïµÄ£¬Òò´Ë±£´æ±»¸Ä¶¯µÄΣº¦¡£Òò´Ë£¬ÔÚ»ñÈ¡GET²ÎÊýʱ£¬Ó¦¸Ã¶Ô²ÎÊý¾ÙÐÐÑÏ¿á¹ýÂ˺ÍУÑ飬±ÜÃâ¶ñÒâ¹¥»÷»òÎó²Ù×÷Ôì³É²»ÐëÒªµÄÇå¾²ÎÊÌâ¡£

×ÛÉÏËùÊö£¬thinkphp¿ò¼Ü¿ÉÒÔÇáËɵØÎüÊÕGET²ÎÊý£¬¿ª·¢Ö°Ô±¿ÉÒÔÎÞаµØʹÓÃRequest¹¤¾ßµÄget¡¢input»òparamÒªÁì»ñÈ¡²ÎÊýÖµ¡£ËäÈ»£¬ÔÚʹÓÃÕâЩҪÁìʱ£¬ÎÒÃÇ»¹ÐèҪעÖØÊý¾ÝÇå¾²ºÍ´úÂë¹æ·¶µÈÎÊÌ⣬²Å»ª¿ª·¢³ö¸ßÖÊÁ¿¡¢Çå¾²¿É¿¿µÄwebÓ¦ÓóÌÐò¡£

ÒÔÉϾÍÊÇÏê½âthinkphpÊÇ·ñ¿ÉÒÔÎüÊÕGET²ÎÊýµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

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

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼

18523999891

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

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

QR code
ÍøÕ¾µØͼ