Question
Write PHP pages that utilize cookies and sessions. In this problem, we will use cookies to store and use user-preference for background font color for
Write PHP pages that utilize cookies and sessions.
In this problem, we will use cookies to store and use user-preference for background font color for paragraph elements. You will need to develop three pages for this project: index.html, saveColor.php, and testColor.php.
1. The index.html page should have a form with two input elements: a color selector and a submit button. The selected color should be sent to the second page (saveColor.php) via post method.
2. The page saveColor.php should retrieve the color code sent by index.html and use it to generate a cookie. The cookie name should be "ParBackColor" and its value should be the color code sent from the first page.
3. The page testColor.php should retrieve the value of the cookie "ParBackColor" and use this value as the background color for all paragraphs on this page. This page should have at least two dummy text paragraphs.
Rubric
Functioning index.html: Proper form that uses a color selector and passes its value to a PHP file : 1 point
Functioning saveColor.php: Correct extraction of passed color and creation of a cookie : 1 point
Functioning testColor.php: Correct retrieval of the cookie value and using it to construct an internal CSS style : 2 Point
Thank you!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started