我爲我的網站創建了index.php頁面,我在下面的代碼的第13行遇到了多個錯誤,但是我已經修復了其中的大多數錯誤。我試過添加網頁重定向工作不正常
</meta>
甚至是 ; ,後 HTTP的當量=「刷新」
這裏是我的代碼:
<?php
session_start();
$username = $_SESSION['username'];
$password = $_SESSION['password'];
if(!$username && !$password){
echo "You will be redirected to login in 5 seconds! (<meta http-equiv="refresh"; content="5; URL=login.php"></meta>)";
}else{
echo "Welcome , ".$username."! (<a href=logout.php>Logout</a>)";
}
?>
問題是你雙引號內的雙引號..用\轉義它們或用單引號代替。 – 2014-11-05 01:39:27
@jaytemp所以「回聲」您將被重定向到5秒內登錄! ()「;」should work? – 2014-11-05 01:41:35
是的,應該可以工作,並且meta標籤自動關閉。沒有必要'' – Ghost 2014-11-05 01:43:35