Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 服务器未检测到CSS样式表路径404未找到错误?_Php_Css - Fatal编程技术网

Php 服务器未检测到CSS样式表路径404未找到错误?

Php 服务器未检测到CSS样式表路径404未找到错误?,php,css,Php,Css,我有一个名为Header.php的头文件,如下所示: 它位于名为includes的文件夹中,因此路径为includes/header.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html dir="ltr" lang="en-US" xmlns="http://www.w3.org/1999/xhtml"&g

我有一个名为Header.php的头文件,如下所示:

它位于名为includes的文件夹中,因此路径为includes/header.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
<html dir="ltr" lang="en-US" xmlns="http://www.w3.org/1999/xhtml">

    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <title>***</title>
        <link rel='stylesheet' href='../_layout/scripts/jquery.fullcalendar/fullcalendar.css' type='text/css' media='screen' />
        <link rel='stylesheet' href='../_layout/scripts/jquery.fullcalendar/fullcalendar.print.css' type='text/css' media='print' />
        <!-- Styles -->
        <link rel='stylesheet' href='style.css' type='text/css' media='all' />
        <!--[if IE]>

            <link rel='stylesheet' href='../_layout/IE.css' type='text/css' media='all' />      

        <![endif]-->
        <!-- Fonts -->
        <link href='http://fonts.googleapis.com/css?family=Droid+Sans:regular,bold|PT+Sans+Narrow:regular,bold|Droid+Serif:i&amp;v1' rel='stylesheet' type='text/css' />

            <script type='text/javascript' src='../../../ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min97e1.js?ver=1.7'></script>
        <!-- WYSISYG Editor -->
        <script type='text/javascript' src='../_layout/scripts/nicEdit/nicEdit.js'></script>

        <!-- Forms Elemets --> 
        <script type='text/javascript' src='../_layout/scripts/jquery.uniform/jquery.uniform.min.js'></script>
        <link rel='stylesheet' href='../_layout/scripts/jquery.uniform/uniform.default.css' type='text/css' media='screen' />

        <!-- Scripts -->
        <script type='text/javascript' src='../_layout/custom.js'></script>


    </head>  
<body>

        <div id="layout">
            <div id="header-wrapper">
                <div id="header">
                    <div id="user-wrapper" class="fixed">
                        <div class="color-scheme">
                            </div>
                            <div class='user'>
                        <?php
                        if($_SESSION['user'] != 'NULL')
                        {
                        ?>
                        <img src="../_content/user-img.png" alt="" />
                        <span>Welcome <a href="#">Admin <?PHP echo $_SESSION['user']; ?></a></span>
                        <span class="logout"><a href="#">Logout</a></span>
                        <?php
                        }
            ?>


                    </div>
                     </div>
                    <div id="launcher-wrapper" class="fixed"><img src="../_layout/images/NGBU Logo.png" width="68" height="81" alt="logo" style="margin-left:35px;" /> <img src="../_content/NGBU_logo.png" width="777" height="57" alt="logo" longdesc="http://index.php" style="margin-top: 25px; float: left; margin-left: 25px;"/></div>


            </div>
            </div>

***
欢迎
我在Index.php的开头调用了这个文件,但由于某些原因,它没有从托管服务器呈现,尽管它是在我在localhost下测试时呈现的

文件夹admin中的My index.php如下所示:

<?PHP
session_start();
ob_start();
$_SESSION['user'] = "NULL";
$_SESSION['password'] = "";
$_SESSION['error'] = 0;
include_once("../includes/header.php");
if(!$_SESSION['error'])
$_SESSION['error'] = "Please Login to Continue";
?>
<?PHP
if(isset($_REQUEST['check']))
{
    if(!$_REQUEST['User'] == "")
    {
        if(!$_REQUEST['Password'] == "")
        {
            $_SESSION['user'] = $_REQUEST['User'];
            $_SESSION['password'] = $_REQUEST['Password'];
            unset($_SESSION['error']);
            header('Location: checklogin.php'); 
        }
        else
        {
        $_SESSION['error'] = "<FONT color='#FF0000'>Both fields are required</FONT>";
        }
    }
    else
    {
    $_SESSION['error'] = "<FONT color='#FF0000'>Both fields are required</FONT>";
    }
}
?>
<DIV class="page fixed">
<DIV id="sidebar" style="height:400px; width:250px; margin-left:5px;"> </DIV>
<DIV id="content">
                <?PHP
echo "<h1 style='margin-left:150px;' >".$_SESSION['error']."</h1>";

?>
                <FORM action="index.php" method="post" name="loginfrm"  class="form-elements-inputs" style="margin-left:150px;width:90px;">
                <INPUT class="normal" type="text" name="User" value="User Name" /><BR />
                <INPUT class="normal" type="password" name="Password" value="Password"  /><BR />
                <INPUT type="hidden" name="check" value="login" />
                <INPUT type="submit" value="Login" class="button-orange" style="width:100px; margin:auto;"  />  
                    </FORM>
                </DIV>
    </DIV>
    </div>
    </BODY>
</HTML>



style.css文件位于includes文件夹中header.php的旁边,那么为什么不应用它呢

在检查mozilla中的firebug时,它会向我显示以下输出:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 2.0//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html lang="en-US" xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
<head>
<title>***</title>
<link type="text/css" href="style.css" rel="stylesheet">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /style.css was not found on this server.</p>
<p>Additionally, a 404 Not Found
error was encountered while trying to use an ErrorDocument to handle the request.</p>
<hr>
<address>Apache Server at www.***.com Port 80</address>
</body></html>
</link>
<link media="screen" type="text/css" href="scripts/jquery.fullcalendar/fullcalendar.css" rel="stylesheet">
<link media="print" type="text/css" href="scripts/jquery.fullcalendar/fullcalendar.print.css" rel="stylesheet">
<link media="screen" type="text/css" href="scripts/jquery.uniform/uniform.default.css" rel="stylesheet">
<link type="text/css" rel="stylesheet" href="http://fonts.googleapis.com/css?family=Droid+Sans:regular,bold|PT+Sans+Narrow:regular,bold|Droid+Serif:i&v1">
<script src="../../../ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min97e1.js?ver=1.7" type="text/javascript">
<script src="../_layout/scripts/nicEdit/nicEdit.js" type="text/javascript">
<script src="../_layout/scripts/jquery.uniform/jquery.uniform.min.js" type="text/javascript">
<script src="../_layout/custom.js" type="text/javascript">
</head>
<body>
</html>

***
404找不到
找不到
在此服务器上找不到请求的URL/style.css

此外,未找到404 尝试使用ErrorDocument处理请求时遇到错误


位于www.**.com端口80的Apache服务器
当路径正确时,为什么会出现404未找到错误


请帮助

您正在包括
。/include/header.php
和style.css,即
。/include/style.css
。因此,您必须使用css的相同相对路径或绝对路径
/include/style.css

指向css文件的链接应与您正在查看的页面的URL相对


例如,如果您在
example.com
查看页面,则必须使用
example.com/includes/style.CSS

引用CSS文件,可能最好先使用header.php绝对路径进行测试。 另外,脚本和样式表的路径应该是相对于index.php而不是头的。
(很抱歉英语不好)

你的
index.php
style.css
的完整路径是什么
style.css
必须位于您的www文档树中,并且可以从apache服务器访问。