早上好, 我正在尝试使用superglobal" $ _ GET"在PHP课程中,但我的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,'/',
......
}
答案 0 :(得分:0)
if(isset($_GET['album'])) //missing paranthesis here.............
{
$this->a = $_GET['album'];
}else{
$this->a = null
}
答案 1 :(得分:0)
看起来你正在用逗号连接url:
'upload_dir' => dirname($this->get_server_var('SCRIPT_FILENAME')).'/files/',$a,'/',
'upload_url' => $this->get_full_url().'/files/',$a,'/',
但如果$ a为null,则会得到双斜杠。而这一行缺少分号
$this->a = null