php - 在 php 中注销时出现 500 内部服务器错误
问题描述
我正在使用 wamp 服务器。错误是:服务器遇到内部错误或配置错误,无法完成您的请求。当我单击注销时,它正在重定向到此错误。代码logout.php:
<?php
session_start();
session_destroy();
header('location:login.php');
?>
登录.php:
<!DOCTYPE html>
<html>
<head>
<title>login and registration</title>
<link rel = "stylesheet" type = "text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class = "container">
<div class ="login-box">
<div class = "row">
<div class = "col-md-6 login-left">
<h2>Login here</h2>
<form action = "validation.php" method="post">
<div class = "form-group">
<label>Username</label>
<input type = "text" name ="user" class="form-control" required>
</div>
<div class = "form-group">
<label>Password</label>
<input type = "Password" name ="password" class="form-control" required>
</div>
<button type="submit" class="btn btn-primary">Login</button>
</form>
</div>
<div class = "col-md-6 login-right">
<h2>Register here</h2>
<form action = "registration.php" method="post">
<div class = "form-group">
<label>Username</label>
<input type = "text" name ="user" class="form-control" required>
</div>
<div class = "form-group">
<label>Password</label>
<input type = "Password" name ="password" class="form-control" required>
</div>
<button type="submit" class="btn btn-primary">Register</button>
</form>
</div>
</div>
</div>
</div>
</body>
</html>
解决方案
推荐阅读
- c# - Xamarin 表单 - JSON - 获取嵌套值
- servicenow - 使用 Azure VM 的 ServiceNow Midserver 故障转移集群
- laravel - ftp_mkdir():OOPS:malloc
- git - Rust cargo 在 docker 中获取私有 github 存储库
- sql - 当我们需要在 SQL 中使用无法通过基于集合的方法解决的游标时的示例
- dom - 使用 DOMSubtreeModified 事件检测 dom 更改
- javascript - 计算输入之间的百分比,然后使用 Jquery 根据结果百分比更改背景颜色
- azure - 如何在 APIM 策略中定义数组变量
- google-bigquery - bigquery 中的 REGEXP_CONTAINS 顺序和 Case 语句
- redis - Redis 与 etcdv3 的性能差异