2013-11-24 36 views
0

我得到以下错误消息:PHP法塔错误:需要():失败开口所需 '代表为registration.php'

[24-NOV-2013 10时59分00秒欧洲/斯德哥尔摩] PHP致命错误:require():无法在/Applications/MAMP/htdocs/reg4event/register.php中打开所需的'repregisration.php'(include_path ='。:/ Applications/MAMP/bin/php/php5.4.10/lib/php')上线46

脚本register.php看起来是这样的,其中线46存在:

// Check if SESSION is SET 
if ((isset($_SESSION["RegType"])) && (isset($_SESSION["eventId"]))) { 
    // Check if it is a Rep Registration or a Guest Registration 
    if ($_SESSION["RegType"] == "rep") { 
     // The Registration if of type "rep", require the repregistration script 
     require "repregisration.php"; 

    } elseif ($_SESSION["RegType"] == "guest") { 
     // The Registration if of type "guest", require the guestregistration script 
     require "/snippets/guestregistration.php"; 

    } else { 
     // Neither of "rep" or "guest" was set in the $_SESSION["RegType"], hence header back to index.php page 
     header("Location: index.php"); 
     exit(); 

    } 
} else { 
    header("Location: index.php"); 
} 

repregistration.php文件包含此:

<?php 
// Check which STAGE the Rep registration process is in 
if (!isset($_SESSION["RegStage"])) { 
    // Include the Registration script 
    require "/pages/repform.php"; 

} elseif (isset($_SESSION["RegStage"]) == "review") { 
    // Include the Review script for the registration to confirm their details 
    exit("RegStage Review has not been created!"); 

} elseif ($_SESSION["RegStage"] == "confirmed") { 
    // Include the Confirmed information 
    exit("RegStage Confirmed has not been created!"); 

} else { 
    header("Location: index.php"); 
    exit(); 
} 
?> 

为什么我收到错误信息?

+0

同一目录中的所有文件? – Darren

+0

@dbh是的。 – Andreas

回答

2

您的文件名是repregistration.php,但您的包括require "repregisration.php"; - 包含行中存在拼写错误。

+0

谢谢!无论我多久查找拼写错误,我总是会想念他们。 :) – Andreas

相关问题