Web Development Assignment 5: Functions & Roles Build upon the existing family / friend / pet tree website. In order to prevent unauthorized access to the family or friend or pet tree, develop a login page that fronts these pages and requires a session for their viewing. Two functions are necessary and should be created in the file “function.php.” Include function.php on each of the relevant family / friend / pet pages using the “include” function in php. Create a PHP login function that checks to assure users are authenticated that are viewing the tree. Set a user session upon login. For the second function, create a PHP role function that only allows those with the website administrator role to update the tree with new content. To associate a role with a username you can use an array or a database table if you are ahead in your reading. Name your functions using your last name. For example, the two functions could be “Anderson_Login()” and “Anderson_role()”. Allow the username “customer” and password “customer” to successfully login to the website. Allow the username “admin” and password “admin” to successfully login to the website. If the username/password is wrong, the instructor may not be able to grade this and you will received a reduction in points. 1. Create a login function. The login function must check to determine whether the customer or admin sessions are set on all family/friend member pages. Create a proper session for the “customer” and “admin” usernames upon authentication. Each page of the family tree should require a session to be set and the user to be authenticated in order to view it. If no session exists, the user should be given a message indicating they are not authenticated and be automatically redirected back to the login page. If redirects are not working on your webhost you can create a URL or use an include to include the login.php page. Proper form validation should be used on the login and special characters for the password field that disallow bystanders from seeing the password. In addition, if a session exists the footer of each web page should have a logout link. When the logout link is clicked, the user should be asked to confirm or cancel their logout. Once confirmed, the session should be destroyed. 2. Create a role function. The role function will identify whether the authenticated individual is either a customer or a website administrator. Once authenticated, the role function will print the role of the logged in user next to the logout link. If the role of the user is a website administrator authenticated with the username “admin,” allow the user to update the content for each member of the tree. If the authenticated user is not “admin,” disallow updates to the family / friend / pet tree, it should be read only. Remember to name all of the function variables beginning with your last name in your code. Store the functions in a separate PHP file called “function.php.” Include the function.php in your family / friend / pet tree pages using the PHP include or include_once function.

Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code "Newclient" for a 15% Discount!

NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.