@OctoberWindMay 07.2010 — #Most common is probably via $_SESSION
In this app, I track a number of actions based on the users email, so I just check for that where necessary.
[code=php] // among other sanitization/verification $email = mysql_real_escape_string($_POST['email']);
$query = "select * from pten_toolbox_users where email = '$email' limit 1"; $result = mysql_query($query, $link);
if ($users = mysql_fetch_assoc($result)){
// set what you want to track 'logged in status' to a session variable // be sure to session_start() at the top of every page that needs validation // even if you don't use the session, you still need to pass the variables via session_start() $_SESSION['user_email'] = $email; // email registered; redirect to vote header("Location: index.php");
@tirnaMay 08.2010 — #In the authentication script where you check if the user entered username/password pair match that in your database, you assign a value to a session variable if the username/password are correct.
Then on every page where you need a user to be logged in you simply check if the above session variable exists [B]and[/B] if it is set to the correct value. If it is, then you let the script in the web page run.
@narutodude000authorMay 08.2010 — #I found a function in my file that determines whether or not an user is logged in (I'm using a site builder). Thanks anyways.