我要为我的一个项目编写一个后端。昨天我做了登录和注销功能。在Backed中有一个导航点叫logout:
if (isset($_GET['act'])) {
$selection = $_GET['act'];
switch ($selection) {
case "home":
include("include/home.php");
break;
case "registration":
include("include/registration.php");
break;
case "cusadm":
include("include/cusadm.php");
break;
case "history":
include("include/history.php");
break;
case "logout":
include("include/logout.php");
break;
default:
include("include/home.php");
注销.php
<?php
$_SESSION = array();
header('Location:index.php');
?>
我现在的问题是我的表单现在有链接,并且每个链接都会注销。
这是一个截图: http ://s13.postimage.org/s4k7akc5j/problem.jpg
那么我该如何解决这个问题呢?