Get Cookie Data
<?php $user = $_COOKIE['firstname']; $color = $_COOKIE['fontcolor']; ?> <html> <head> <title>Get Cookie Data</title> <style type = "text/css"> body { color: <?php echo( $color ); ?> } </style> </head> <body> <h1>Hello <?php echo( $user ); ?>! </h1> </body> </html>
1. | Checking for Cookie Support from PHP | ||
2. | Setting and Printing a Cookie Value | ||
3. | Reading a cookie value | ||
4. | Printing a cookie value | ||
5. | Still Logged In with cookie | ||
6. | Reading all cookie values |