我已创建member.php
,并且只有在用户登录了正确的凭证后才能访问此页面。如果没有,它会将它们重定向到index.php
。这是代码此网页有重定向循环
<?
ob_start();
?>
<!DOCTYPE html>
<html>
<head>
<title>Prime Time</title>
<link href="member.css" rel="stylesheet" type="text/css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="loadmessages.js"></script>
<?php
if ($_SESSION['username']){
session_start();
}
else
header('Location:http://website.com/website/index.php');
ob_end_flush();
?>
</head>
然而,当我运行此我得到的错误"This webpage has a redirect loop"
器(Chrome) 哪些错误的代码? 谢谢!
我喜欢你的最后一次更新。这很好:D –
@ErmanBelegu:我该说什么?我有点惊讶 –