Hour 19. Saving State with Cookies and Query Strings
What You’ll Learn in This Hour:
What cookies are and how they work
How to read a cookie
How to set a cookie
How to use cookies to store site usage information in a database
About query strings
How to build a function to turn an associative array into a query string
HTTP is a stateless protocol. Therefore, every page a user downloads from your server represents a separate connection. On the other hand, Web sites are perceived by users and publishers alike as environments, as spaces within which a single page is part of a wider whole. It’s not surprising, therefore, that strategies to pass information from page to page are as old as the Web itself.
In this hour, we will examine two methods of storing ...
Get Sams Teach Yourself PHP in 24 Hours, Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.