new@php Posted August 17, 2007 Share Posted August 17, 2007 Hey Guys, I need some help please. I have taken on a project which is slightly beyond me at the moment! I have been asked to complete a PHP Login Script that by the looks of it uses OOP. I have been given some files in which the script has been set up by it needs to be completed to do the following: User arrives at Login >>> User Logins in Successfully >> create User object and save in $_SESSION >> redirect to homepage >>> homepage retrieves User from session and displays "welcome username" If there no login registered then the user should be redirect to the login page. the same should be done if the username is not recognized. I have the following files on and scripts: index.php Code: <div id="Header">Header</div> <div id="Body">[WELCOME]</div> <div id="Footer">Footer</div> Login.php Code: <div id="Header">Header</div> <div id="Body">[LOGIN FORM]</div> <div id="Footer">Footer</div> Both these pages also contain: PHP Code: <?php require '_includes/_includes.php'; ?> These include files are: User.php PHP Code: <?php class User { var $id; var $username; var $password; var $firstName; var $lastName; var $active; var $email; function User($row) { $this->username = $row['username']; } } ?> and UserManager.php PHP Code: <?php class UserManager { function UserManager() { } function login ($username, $password) { return new User (); } function checkUserLoggedIn () { return false; } } ?> Can anyone help me out here with some possible solutions and maybe an explanation? As I'm kind of at a loss! I know a form is required which is straightforward enough and a login script but how do i integrate the current User.php and Usermanager.php files? Many thanks! Seb Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.