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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!