URL ending with something like portal.php?key2=hello , how can I get the value "key2"?
portal.php?key2=hello
var_dump( $_GET['key2'] );
$_GET['key2']
you will get the value from the query string.
$_POST['key2']
will provide you the value from the published form.
$_REQUEST['key2']
will provide you with any of the above, if one exists.
GET data is decoded into the $ _GET superglobal array. See http://php.net/manual/en/language.variables.external.php