Can anyone direct me to a site where I can find just the basics of a php session user system, login/register/memberspage/logout. I need it to help me understand sessions a bit more, thanks.
It's dead simple... When a user logs in, you check his details against those in the DB. If 0 results are returned, he's not logged in and you give an error. But if his record is returned, you log him in, and set a session variable ($_SESSION) like a flag such as $_SESSION['logged_in'] = true; . Then you check whether that flag is set to true to display/redirect to your members content. A log out link just needs to link to a page with something like the following on: <?php // Destroy session session_unset(); session_destroy(); // Redirects user back the way they came if $_SERVER['HTTP_REFERER'] is set // Else, sends them home if ( isset( $_SERVER['HTTP_REFERER'] ) ) { header( 'Location: ' . $_SERVER['HTTP_REFERER'] ); exit; } else { header( 'Location: /' ); exit; } ?> Code (php): Much simpler than you might think. Hope that helps.