0

Hello everyone I have created a simple web-application. The sign up and login are working fine. It has two form pages namely signuppage and login page and main website page name index.html which the user will see when he will be successfully logged in. on this page I have created a log out button . As soon as the user will click the log out button he should be logged out but when I click the log out button I see this on new page which is my logout.php code.

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

this is my logout button in inde.html:

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

<button type="submit" name="submit" class="btn btn-info" id="logout"> 
Logout 
</button>
</form>       
Hafsa
  • 361
  • 1
  • 4
  • 6

0 Answers0