找不到错误对象在此服务器上找不到请求的URL

时间:2020-10-05 17:24:53

标签: php

我正在制作一个类似于stackoverflow网站的网站,当我尝试访问signin.php或注册页面时仍然出现错误,请说: 找不到对象! 在此服务器上找不到请求的URL。推荐页面上的链接似乎有误或已过时。请将该错误告知该页面的作者。

如果您认为这是服务器错误,请与网站管理员联系。

错误404。

请注意,我可以毫无问题地访问其他页面(index.php,questionDetails.php等)

然后当我进行搜索以查看为什么得到此错误时,我发现我缺少诸如.htaccess文件之类的东西。

所以她的项目看起来像这样:

层次结构: hirarchy of my files

navbar.php文件:

<?php 
if (! isset($_SESSION)) {
    session_start();
    
}
echo $_SERVER['PHP_SELF'];
 ?>
<!DOCTYPE html>
<html>
<style type="text/css">
    .brand{
        font-family: fantasy;
    }
    .ulNavbar{
        display: inline-flex;
    }
</style>
<nav class="nav-wraper white ">
    <div class="container">
        <a href="index.php" class="brand-logo brand black-text">UnivBatna</a>

        <a href="#" class="sidenav-trigger" data-target='mobile-links'>
            <i class="material-icons blue-text">menu</i>
        </a>
       
    <ul class="right hide-on-med-and-down ulNavbar">
       <?php if (!empty($_SESSION['username'])){ ?>
            <img src="../imgs/yuna.jpg" alt="image" width='40px' height='50px' alt="" class="circle responsive-img img-profile">
             <p class="right black-text"> <?php echo $_SESSION['username']; ?></p>
                     
                     <button id="logout">LogOut</button>
                     <form action="../includes/logout.inc.php" method="POST">
                        <input type="submit" name="logout" class="btn" value="Logout">
                     </form>
                <?php } else{ ?>

             <li><a href="./auth/Signin.php" class="btn brand">sign In</a></li>
             <li><a href="./auth/Signup.php" class="btn brand">sign up</a></li>

               <?php } ?>
        
    </ul>

    </div>
    
</nav>

<ul class="sidenav" id="mobile-links">
   <li><a href="addquestion.php" class="btn blue">Add Question</a></li>
</ul>

</html>

index.php文件



<!DOCTYPE html>
<html>
<?php include('./templates/header.php') ;?>
<?php include('./dashboard/Dashboard.php') ?>
<?php include('./templates/footer.php'); ?>


</html>

我认为我在这里错过了一些东西。 已经谢谢了

0 个答案:

没有答案
相关问题