I have some questions about these codes. I've been trying to get them to work, but I could not.
First of all, the input tag, if the user inputs a wrong input, I want to keep the info they input and show an error. I tried this, but it did not work
- Code: Select all
<label>Username</label>
<input type="text" name="username" maxlength="20" size="25" value="<?php echo $_POST['username']; ?> " />
Second, when the user clicks "Log Out", I want the session to end and the user should be directed to the index.php page. I wrote this code, but it does not take the user anywhere, it gives a blank page.
- Code: Select all
<?php
require_once 'session.php';
if (isset($submit)) {
session_destroy();
header('Location: index.php');
exit;
}?>
Your help is really appreciated.
Thanks in advance.



