我有一个PHP脚本来做一些验证,如果验证关闭,它应该返回404。但它没有。脚本没有返回404
下面是脚本的开头:
<?php
include '../connect.php';
include '../global.php';
include '../utils/api/problems.php';
include '../utils/api/suggested_solutions.php';
include '../utils/api/attempted_solutions.php';
include '../utils/api/categories.php';
$problem_id = mysql_real_escape_string($_GET["problem_id"]);
// Get member_id from session
$member_id = $_SESSION['user_id'];
// Validate the call
if (empty ($problem_id) || !isset ($problem_id) || !is_numeric ($problem_id))
{
$referer = $_SERVER['HTTP_REFERER'];
// Send me an email with the error:
$from = "from: [email protected]";
$to_email_address = 'my_email';
$error_subject = 'Error happened when getting problem_id from request';
$contents = 'Error in problem.php - here is the referer: '.$referer;
//mail($to_email_address, $error_subject, $contents, $from);
error_log (".......error validating problem id in problem.php");
header('HTTP/1.1 404 Not Found');
}
但出于某种原因,这并不返回404 - 任何想法,为什么?
谢谢!
什么** **并使其返回?一个空白页面的任何机会? – ManseUK 2012-01-04 17:33:42
你打开了display_errors吗?你不知道有关已经发送的头文件的错误吗? – Hossein 2012-01-04 17:37:31