如何表明正确的PHP路径?

时间:2016-06-25 17:39:12

标签: php

我在php require_once()

中指出文件路径有些困惑

这是我的文档结构:

httpdocs/
         |- includes/ 
         |          |- footer.php
         |          |- header.php
         |
         |
         |- signin/   config/
         |        |         |- membersite_config.php
         |        |
         |        |- access.php
         |        |- login.php
         |        |- login-home.php
         |        |- page3.php
         |
         |- index.php
         |- page1.php
         |- page2.php

这是我现有的index.php代码:

<!DOCTYPE html>
<html lang="en">

<?php
$page_title = "page title | site name";
$page_description = "page description";
?>

<?php include("includes/header.php"); ?>

<body>
 Page body

<?php include("includes/footer.php");?>
</body>
</html>

我需要在index.php文件的顶部添加此代码。虽然相同的代码在page3.php上工作正常但它显示500错误 请帮我写下确切的路径。

//I need to add this code with correct path.

<?PHP
require_once("signin/config/membersite_config.php");

if(!$fgmembersite->CheckLogin())
{
$fgmembersite->RedirectToURL("signin/login.php");
exit;
}
?>

//existing code

<!DOCTYPE html>
<html lang="en">

<?php
$page_title = "page title | site name";
$page_description = "page description";
?>

<?php include("includes/header.php"); ?>

<body>
 Page body

<?php include("includes/footer.php");?>
</body>
</html>

0 个答案:

没有答案