O'Reilly logo

PHP for Teens by Maneesh Sethi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Putting a Cookie in Your Site

Now it is time to put your knowledge into action. We are going to develop a couple pages with cookies, starting off with the one described earlier, which allows the user to enter a name on the form, which the web page remembers for a long period of time. The first thing we need to do is develop an HTML document. This HTML form allows the user to enter his name. From there, we will develop a couple of PHP forms that display the user’s name.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>Developing a page with cookies</title> </head> <body> Please enter your name into the following text box and hit submit. Note that if you have entered ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required