我有一個網址,我試圖提取一些參數。 我的網址可以有兩種形式,
無論是 '代碼' 或 '刷新' 但它返回null,甚至想到了參數設置
URL鏈接 - >與 'CODE'http://www.example.com/token.php?client_id=hello&client_number=blahblah&type=authcode&code=hello23423
網址 - > WITH '刷新'http://www.example.com/token.php?client_id=hello&client_number=blahblah&type=authrefresh&refresh=74388bye
$token = "NULL";
$client = $_GET['client_id'];
$secret = $_GET['client_number'];
$type = $_GET['type'];
if (isset($_POST["code"])) {
$token = $_GET['code'];
}
if (isset($_POST["refresh"])) {
$token = $_GET['refresh'];
}
echo $client; // $client, $secret and $type is printed without any issues
echo $secret;
echo $type;
echo $token; <---- Always returns NULL even though the URL has the parameters CODE or REFRESH
'isset($ _ POST [ 「代碼」])'?爲什麼'後'?爲什麼? –