2015-12-04 77 views
0

我有註銷圖標。問題是,當我點擊註銷圖標時,它會將我註銷,但我註銷表單的設計看起來不同,鏈接也是錯誤的,而不是index.html,它將我鏈接到logout.php剛刷新後我在右側路徑。PHP註銷鏈接錯誤

可能是我的問題? html頁面上

那,我設置的鏈接logout.php

<li><a href="logout.php"><i class="fa fa-sign-out"></i></a></li> 

index

那我logout.php代碼

<?php 
    session_start(); 
    session_destroy(); 
header("Location: index.php"); 
?> 

logout

回答

0

語法錯誤

<?php 
    session_start(); 
    session_destroy(); 
header("Location: index.php" 
?> 

缺少右括號,也或許您需要更改重定向的index.html

<?php 
    session_start(); 
    session_destroy(); 
    header("Location: index.php"); // here maybe index.html depending where do you want to redirect 
?> 
+0

喔對不起我的錯誤,我只是忘記了括號這裏,但原來還有右括號。好吧,我會嘗試將其重定向到index.html –

+0

不,這個問題在改變重定向後依然存在 –

+0

因此等待它註銷之後它不會將您重定向到索引頁? – Standej