早上好, 我想在PHP類中使用超全局的「$ _GET」,但是我的4個解決方案都沒有工作......這是我最後一次嘗試,有人可以請告訴我什麼是錯的? 謝謝
public $a;
function __construct($options = null, $initialize = true, $error_messages = null) {
$this->response = array();
if(isset($_GET['album']){
$this->a = $_GET['album'];
}else{
$this->a = null
}
$this->options = array(
'script_url' => $this->get_full_url().'/'.basename($this->get_server_var('SCRIPT_NAME')),
'upload_dir' => dirname($this->get_server_var('SCRIPT_FILENAME')).'/files/',$a,'/',
'upload_url' => $this->get_full_url().'/files/',$a,'/',
......
}
您的URL是否包含'?album ='? –
Epodax
當然,這樣做,我試過幾個值.. –
你可以考慮傳遞$ _GET給構造函數(如更好的設計方法) – BobbyTables