Php 重定向到下一个位置无效

Php 重定向到下一个位置无效,php,Php,标题('Location:../Holiday\u Planer/Login Success.php')在大多数情况下都应该有效。 您可以尝试header('url:../Holiday\u Planer/Login Success.php');如果没有,则。标题位置应为绝对URL路径(例如:/path from doc root to/Holiday\u Planer/Login Success.php),不是一个相对的文件路径。你能说明你的目录结构吗?例如,给定的代码在哪个文件中,目标文件在

标题('Location:../Holiday\u Planer/Login Success.php')在大多数情况下都应该有效。
您可以尝试header('url:../Holiday\u Planer/Login Success.php');如果没有,则。

标题位置应为绝对URL路径(例如:
/path from doc root to/Holiday\u Planer/Login Success.php
),不是一个相对的文件路径。你能说明你的目录结构吗?例如,给定的代码在哪个文件中,目标文件在哪里?它是实际的头文件本身,正如我注释出来的,脚本运行良好并返回一个值。我厌倦了这两种方法,每次都返回错误404
<?php
session_start();
if(isset($_POST["submit"])){
require 'Config.php';

    $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
    $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    try {
      $Name = $_POST['Name'];
      $Password = $_POST['Password'];
      $message ="";

      $stmt = $conn->prepare("SELECT * FROM user WHERE Name='$Name' and Password='$Password'");
      $stmt->execute();
      $result = $stmt->fetchcolumn();

         if($result == 0) {
           echo $result;
           echo "Invalid Username or Password";
         }
         elseif($result >= 1) {
           echo $result;
           $_SESSION['Name']=$result['Name'];
           header('Location: ../Holiday_Planer/Login-Success.php');
           exit();
     }
   }
   catch(PDOException $e) {
    echo $e->getMessage();
   }
   $conn = null;
  }
?>