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
精彩评论