Page 1 of 1

Part 3: Team Member’s Login • Write a PHP file that will output a form containing 2 fields: username and password. Upon

Posted: Tue Jul 12, 2022 8:05 am
by answerhappygod
Part 3: Team Member’s Login • Write a PHP file that will outputa form containing 2 fields: username and password. Upon submissionof the form, the code should check against the database to seewhether the username password pair was correct. If so, display awelcome message as well as the user’s task list. If not, displaythe message “Invalid username or password” followed by the samelogin form. • A successful login should set some session variableso that the server knows that the user is logged in. For example,set $_SESSION[‘loggedin’] to be “YES”. • When the page is loaded,check the session variable. If the user is logged in, display thewelcome message and user’s task list instead of the login form. •Add a “Remember me!” checkbox to the login form. If the box ischecked and the login is successful, save a cookie that identifiesthe user to the server. On further visits to the page, the usershould appear logged in, even if the browser has been closed. Youmay choose a reasonable expiration time for the cookie.