php - 找不到错误对象在此服务器上找不到请求的 URL
问题描述
我正在制作一个类似于 stackoverflow 网站的网站,当我尝试访问 signin.php 或注册页面时仍然出现错误说:找不到对象!在此服务器上找不到请求的 URL。引用页面上的链接似乎是错误的或过时的。请将该错误通知该页面的作者。
如果您认为这是服务器错误,请联系网站管理员。
错误 404。
请注意,我可以毫无问题地访问其他页面(index.php、questionDetails.php、...)
然后当我进行搜索以了解为什么会出现此错误时,我发现我缺少诸如 .htaccess 文件之类的东西。
所以她我的项目是什么样子的:
层次结构: 我的文件层次结构
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>
我认为我在这里遗漏了一些东西。已经谢谢了
解决方案
推荐阅读
- python - DJANGO 3.0:从查询集中列出(基础级问题)
- java - 杰克逊不反序列化属性值
- angular - 材料 8 库不适用于 AOT 模式
- python - 为什么我不能在 Python 中使用 OpenCV 多次使用我的网络摄像头进行捕获?
- awk - 对特定列的值求和,直到达到某个值
- java - 如何获取 Spring Boot @Async 方法被拒绝任务的详细信息?
- tabulator - 制表符“自动完成”问题
- android - 如何从firebase数据库中的纬度和经度中检索地址?
- python - Python Turtle 出现大量错误
- azure-devops - 禁用部署批准挂起通知