1)
我有这个:
function ObtainRequest($Field, $Method) {
$Returned = "";
if ($Method == "POST")
$Returned = $_POST[$Field];
else if ($Method == "GET")
$Returned = $_GET[$Field];
else
$Returned = $_REQUEST[$Field];
return $Returned;
}
现在,使用该功能:
if (isset(ObtainRequest("OneField","POST"))) {
DoSomething();
} else if (!isset(ObtainRequest("OneField","POST"))) {
DoOtherthing();
}
但是我的脚本没有运行(SHOWING PLANK PAGE)...
我的错误是什么?
2)
$_REQUEST
函数内部丢失了?
此代码有效!:
if (isset($_REQUEST["OneField"])) {
DoSomething();
}
此代码不起作用!:
if (isset(ObtainRequest("OneField","REQUEST"))) {
DoSomething();
}
此代码不起作用!:
if (empty(ObtainRequest("OneField","REQUEST"))) {
DoSomething();
}
3)
它也适用于 Session 吗?