我正在为大学做一个数据库项目,但实际上我的问题与html或css有关(我认为)。
这就是问题:我在网站周围有一个导航栏,但是当我在某些页面上时,我无法访问其他页面,例如当我在“更改密码”页面时,我将鼠标放在“注销“无法点击。
提前感谢,André
以下是代码:
<div id="linking">
<ul>
<li>
<a href="index.php">Home</a>
</li>
<li>
<a href="trips.php">Search for trips</a>
</li>
<?php
if (isset($_SESSION['user_logged_in'])) {
if (($_SESSION['user_email']) === "admin@email.com") {
?>
<li>
<a href="new_tour.php">Create tour</a>
</li>
<li>
<a href="new_service.php">Create service</a>
</li>
<?php
}
?>
<li>
<a href='profile.php'>Change settings</a>
</li>
<li>
<a href='change_password.php'>Change password</a>
</li>
<li>
<a href='logout.php'>Log out</a>
</li>
<label>Hello <?php print_r($_SESSION['user_name']) ?>!</label>
<?php
}
else {
?>
<li>
<a href='login.php'>Log In</a>
</li>
<li>
<a href="new_customer.php">Register</a>
</li>
<label>Hello visitor!</label>
<?php
}
?>
</ul>
</div>
这是css:
/* common properties */
body{
background-color: #d8d8d8;
}
hr{
color: firebrick;
background-color: firebrick;
border-color: transparent;
}
.registering {
position: absolute;
left: 30%;
top: 0%;
}
.loging {
position: absolute;
left: 33%;
top: 25%;
}
td{
vertical-align: middle;
}
/* .loging class properties */
body .loging{
position:absolute;
left:32%;
top:25%;
}
.loging td{
padding: 5px;
text-align: center;
font-size: 20px;
font-family: sans-serif;
color: firebrick;
}
.loging td input{
width: 500px;
height: 23px;
border-bottom-right-radius: 10px;
border-top-left-radius: 10px;
border-style: solid;
border-color: transparent;
text-align: center;
font-size: 16px;
}
.loging td input[type="submit"]{
width: 120px;
height: 30px;
background-color: firebrick;
color: #FFFFFF;
font-size: 18px;
font-weight: bold;
border-radius: 0px;
}
.loging td input[type="password"]{
font-size: 24px;
}
/*. registering class properties */
.registering td{
padding: 5px;
text-align: center;
font-size: 18px;
font-family: sans-serif;
color: firebrick;
}
.registering td input{
width: 500px;
height: 23px;
border-bottom-right-radius: 10px;
border-top-left-radius: 10px;
border-style: solid;
border-color: transparent;
text-align: center;
font-size: 16px;
}
.registering td input[type="submit"]{
width: 120px;
height: 30px;
background-color: firebrick;
color: #FFFFFF;
font-size: 18px;
font-weight: bold;
border-radius: 0px;
}
.registering td input[type="password"]{
font-size: 24px;
}
/* .linking properties */
#linking label{
color: firebrick;
font-weight: bold;
float:right;
position: fixed;
left: 90%;
font-family: sans-serif;
font-size: 16px;
}
li{
display: inline;
padding-right: 2px;
padding-left: 2px;
}
a{
color:firebrick;
font-weight: bold;
position: relative;
display: inline-block;
font-family: sans-serif;
font-size: 14px;
text-decoration: none;
}
/* section properties */
section{
padding:5px;
position: absolute;
width:30%;
}
section table{
padding: 8px;
}
section hr{
background-color: #FFFFFF;
}
section td, th{
width:32%;
text-align: center;
}
/* search for trips */
body .search{
position:absolute;
left:32%;
top:25%;
}
.search td{
padding: 5px;
text-align: center;
font-size: 20px;
font-family: sans-serif;
color: firebrick;
}
.search td input{
width: 500px;
height: 23px;
border-bottom-right-radius: 10px;
border-top-left-radius: 10px;
border-style: solid;
border-color: transparent;
text-align: center;
font-size: 16px;
}
.search td input[type="submit"]{
width: 120px;
height: 30px;
background-color: firebrick;
color: #FFFFFF;
font-size: 18px;
font-weight: bold;
border-radius: 0px;
}
Logout.php代码:
<?php
session_start();
unset($_SESSION['user_logged_in']);
session_destroy();
header("Location:index.php");
echo "<script>alert('You have been logged out! Please come back anytime!')</script>";
?>
答案 0 :(得分:0)
我认为您还没有将链接(logout.php)添加到每个页面..