summaryrefslogtreecommitdiffstats
path: root/session.php
diff options
context:
space:
mode:
Diffstat (limited to 'session.php')
-rw-r--r--session.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/session.php b/session.php
new file mode 100644
index 0000000..6125b17
--- /dev/null
+++ b/session.php
@@ -0,0 +1,31 @@
+<?php
+ session_start();
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Hacker's Corner</title>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+</head>
+<body>
+<h2>Phi = 1.618</h2>
+<p>
+<?php
+ $_SESSION['track_name'] = "kyle";
+ $_SESSION['track_browser'] = "firefox";
+
+ /* free: http://docstore.mik.ua/orelly/webprog/pcook/ch08_06.htm */
+ $_SESSION['visited']++; /* pretty cool */
+?>
+<?php
+ $name = $_SESSION['track_name'];
+ $browser = $_SESSION['track_browser'];
+ $visited = $_SESSION['visited'];
+ echo "user is {$name} and uses {$browser} browser, visited {$visited} times.<br />\n";
+?>
+</p>
+</body>
+</html>
+