我正在为 wordpress 开发一个插件,$ _GET 的参数通过 Wordpress 管理面板根据用户的偏好记录在数据库中。以下验证必须通过 $_GET,这是函数:
$db_url = get_option('my_get_url');
// returns the value of the database entered by User
// on this case return --> page=nosupport
$url_explode = explode("=", $db_url);
$url_before = $url_explode[0]; // --> page
$url_after = $url_explode[1]; // --> nosupport
echo "Before: ".$url_before; // here are ok, return --> page
echo "After: ".$url_after; // here are ok, return --> nosupport
我的问题在这里:
// here $_GET no have any value, dont work on validate...
if($_GET[$url_before] != ""){
if($_GET['$url_before']=="nosupport"){
// my function goes here...
}
}
我用于测试参数:
echo $_GET[$url_before];
但不要返回任何值...