私はいくつかのバリデーションを行う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
display_errorsをオンにしましたか?すでに送信されたヘッダーなどについて何かエラーはありませんか?何らかの理由で – Hossein