Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- ?>
- <html>
- <head>
- <meta charset="utf-8">
- <title>PHP Session</title>
- </head>
- <body>
- <?php
- $_SESSION["fav_color"] = "green";
- $_SESSION["fav_animal"] = "cat";
- echo "Session variables are set.";
- ?>
- </body>
- </html>
- <?php
- session_start();
- ?>
- <html>
- <head>
- <meta charset="utf-8">
- <title>PHP Session</title>
- </head>
- <body>
- <?php
- echo "Favorite color is ".$_SESSION["fav_color"];
- echo '<br>';
- echo "Favorite animal is ".$_SESSION["fav_animal"];
- echo '<br>';
- print_r($_SESSION);
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement