Php代码在返回后不执行:false;


Php code does not execute after return:false;

下面的Php代码(最后一页)检查用户是否按下了"回复"按钮,然后执行操作。一切都好,但如果在下面继续的巨大脚本中,我在某个时候触发了来自Php的javascript警报,返回false,它绝对不会做任何事情。。。我如何让Php记住并执行这个部分

if (cmtx_setting('show_reply')) { //if reply field is enabled
        $cmtx_reply_id = trim($_POST['cmtx_reply_id']); //remove any space at beginning and end
        cmtx_is_injected($cmtx_reply_id); //check for injection attempt
        cmtx_validate_reply($cmtx_reply_id, $cmtx_page_id); //validate reply
        $cmtx_reply_to = cmtx_sanitize($cmtx_reply_id, true, true); //sanitize reply
    }

即使在脚本中的某个时刻我有return false;

完整的代码片段:

/* Reply To */
    if (!isset($_POST['cmtx_reply_id'])) { //if reply ID not submitted
        $_POST['cmtx_reply_id'] = 0; //set it with a zero value
    }
    if (cmtx_setting('show_reply')) { //if reply field is enabled
        $cmtx_reply_id = trim($_POST['cmtx_reply_id']); //remove any space at beginning and end
        cmtx_is_injected($cmtx_reply_id); //check for injection attempt
        cmtx_validate_reply($cmtx_reply_id, $cmtx_page_id); //validate reply
        $cmtx_reply_to = cmtx_sanitize($cmtx_reply_id, true, true); //sanitize reply
    } else {
        $cmtx_reply_to = 0;
}

return false;充当杀手——它使脚本运行exists;。例如

<?php
echo "Hello";
return false;
echo "World";

https://eval.in/201188

输出只是:Hello

从阅读文档

[…]返回还结束执行eval()语句或脚本文件。如果从全局范围调用,则当前脚本文件的执行结束