簡體   English   中英

PHP注銷鏈接錯誤

[英]PHP logout link wrong

我有一個注銷圖標。 問題是,當我單擊注銷圖標時,它注銷了我,但是注銷表單的設計看起來與眾不同,並且鏈接也錯誤,而不是index.html,它刷新后將我鏈接到logout.php,我就在右邊路徑。

我可能是什么問題?

在html頁面上,我將鏈接設置為logout.php

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

指數

那就是我的logout.php代碼

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

登出

語法錯誤

<?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 
?>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM