I have managed to get my change_password to work, thanks to the help here.
Now when I try a different login, I seem to be running into trouble. First, I logout and I suspect there is something wrong with my logout code. When I tried to change the password for a different user, it acted as if the session was still set (I think).
PHP Code:
<div id="main">
<?php
// If no first_name variable exists, redirect the user.
if (!isset($_SESSION['first_name'])) {
header("Location: http://www.recse.org/clergy/index.php");
exit(); // Quit the script.
} else { // Logout the user.
$_SESSION = array(); // Destroy the variables.
session_destroy(); // Destroy the session itself.
setcookie (session_name(), '', time()-300, '/', '', 0); // Destroy the cookie.
}
echo '<h3>You are now logged out. </h3><br />
?>
</div>
This code is giving me an error of:
Warning: Cannot modify header information - headers already sent by (output started at /logout.php:24) in /homepages/4/d322583329/htdocs/dev/logout.php on line 37
Line 37 is the setcookie line.
Bookmarks