首页 > 解决方案 > 在 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>

标签: phpwampserver

解决方案


推荐阅读