Right, that tutorial is good but has some security issues and isn't specific to what i'm designng. Anyway, I've roughly laid out what my authentication class will look like, I can work from outside of the object so I just need boolean values obviously.
It's not finalised, just a rough idea, I should check against null values really but that should stop against SQL injections and cross-scripting right?Code:<?php require_once('DBConnector.php'); class Authenticate { var $dbconnection; function Authenticate() { $this->dbconnection = new DBConnector(); } function login($username, $password) { $user = strip_tags(mysql_real_escape_string($username)); $pass = strip_tags(mysql_real_escape_string($passsword)); if($query = $this->dbconnection->query("SELECT mcc_users WHERE username == $user AND password == $pass");) { return TRUE; } else { return FALSE; } } function logout() { session_unset(); session_destroy(); } }