using PEAR in security methods
Posted: Thu May 08, 2008 9:54 pm
referring to http://www.devshed.com/c/a/PHP/Creating ... in-Script/
it took me awhile to fully understand this code and although I can follow the code okay, I feel like this is a round about approach, especially since my provider does not make use of PEAR on their server.
Initially I decided to make a class that uses a method to make a connection to the database with normal php functions and assign that connection to a member of that class and make several other methods that return necessary information from the database.
For example
would access a method to make the user data mysql safe, check the info against that in the db and if true, set all the session/user data and return a boolean value. Now, however, after looking at the code at the link I provided, I started thinking to myself they may have a better approach but I don't know if using objects within objects to establish session and user data is really all that necessary.
Any thoughts or opinions on the subject would be greatly appreciated.
it took me awhile to fully understand this code and although I can follow the code okay, I feel like this is a round about approach, especially since my provider does not make use of PEAR on their server.
Initially I decided to make a class that uses a method to make a connection to the database with normal php functions and assign that connection to a member of that class and make several other methods that return necessary information from the database.
For example
Code: Select all
$check = $obj->check($username, $password);
if($check == true){ // print page }
else { header("location: login.php"); }Any thoughts or opinions on the subject would be greatly appreciated.