注销按钮在html页面中不起作用

时间:2017-07-09 10:13:45

标签: php html logout

大家好,我创建了一个简单的Web应用程序。注册和登录工作正常。 它有两个表单页面,即signuppage和登录页面以及主要网站页面名称index.html,用户将在成功登录时看到它。在此页面上,我创建了一个注销按钮。一旦用户单击注销按钮,他就应该注销,但是当我单击注销按钮时,我会在新页面上看到这是我的logout.php代码。     

if(isset($_POST['submit'])) {
include 'dbh.php';
session_start();
session_unset();
session_destroy();
header("Location: loginpage.php");
exit(); 
} 

这是我在inde.html中的退出按钮:

<form action="logout.php" method="POST">

<button type="submit" name="submit" class="btn btn-info" id="logout"> 
Logout 
</button>
</form>       

0 个答案:

没有答案