i want to redirect index.php which if user click on logout button it redirects to login.php page but it don't. http://localhost:/dropedit/GAMEBOX and if some one type like following it went all wrong like,whole page becomes garbled http://localhost:/dropedit/GAMEBOX/index.php logout button code is Logout ?
i tried but din't find some thing!
Make the login button a part of a form, and have the form submit to index.php. The form will contain an empty input that tells the page that you have been logged out. For example:
<form action = '/' method = 'post'>
<input style = 'display: none;' name = 'logout' value = 'logoutTrue">
<input type = 'submit' value = 'Logout'>
</form>
Next, a simple if statement to check if you have been logged out:
<?php
if (isset($_POST['logout'])) {
$logoutVal = $_POST['logout'];
if ($logoutVal === "logoutTrue") {
header("Location: http://localhost/login.php");
}
}
?>
Uh, this should work, I think? If it doesn't please post the error codes.