我收到此错误,无法显示它的开头或结尾。
确切的错误消息是:
致命错误:在第48行的/home/curricle/public_html/descarga/index.php中的写入上下文中无法使用函数返回值
第48行是:
if (isset($_POST('sms_code') == TRUE ) {
这可能是怎么回事?
这是全部功能:
function validate_sms_code() {
$state = NOTHING_SUBMITED;
if (isset($_POST('sms_code') == TRUE ) {
$sms_code = clean_up($_POST('sms_code'));
$return_code = get_sepomo_code($sms_code);
switch($return_code) {
case 1:
//no error
$state = CORRECT_CODE;
break;
case 2:
// code already used
$state = CODE_ALREADY_USED;
break;
case 3:
// wrong code
$state = WRONG_CODE;
break;
case 4:
// generic error
$state = UNKNOWN_SEPOMO_CODE;
break;
default:
// unknown error
$state = UNKNOWN_SEPOMO_CODE;
throw new Exception('Unknown sepomo code: ' . $return_code);
break;
}
} else {
$state = NOTHING_SUBMITED;
}
dispatch_on_state($state);
}
$state
将不会被修改,NOTHING_SUBMITED
如果已经是该值,则无需将其重置为。