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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply