开发者

How to read the query string in PHP and HTML?

a URL ending with something like portal.php?key2=hello how can I get 开发者_如何学编程the value of "key2"?


$_GET['key2']

will get you the value from a query string.

$_POST['key2']

will get you the value from a form posted.

$_REQUEST['key2']

will get you either of the above if it exists.


var_dump( $_GET['key2'] );


GET data is decoded into the $_GET super-global array. See http://php.net/manual/en/language.variables.external.php

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜