The scenario is like this.
I present a splash page with an option to login at the bottom via form. Across the top is a menu strip, site access is open to all but if logged in and validatd as a member then selecting "downloads" or "articles" from the menu strip gives access to different content. I need my user to only login / validate once on the splash screen and then hold the session data (string stating member or nonmember retrieved from a db) to be accessable from any page within the site.
my test pages are as follows.
login screen
---------------
Expand|Select|Wrap|Line Numbers
- <html>
- <head><title>Title here!</title></head>
- <body>
- <form action = "user.php" method="post">
- <input type="text" name="status">
- <input type="submit" >
- </form>
- <a href="download.php">Downloads</a>
- </body>
- </html>
Expand|Select|Wrap|Line Numbers
- <html>
- <head><title>Title here!</title></head>
- <body>
- <?php
- session_start();
- $x= $_POST['status'];
- session_register("status");
- $status=$x;
- // check session id should be text entered on login screen for test purposes
- echo 'session id is '.$status;
- // re display login screen
- include('base.htm');
- ?>
- </body>
- </html>
Expand|Select|Wrap|Line Numbers
- <html>
- <head><title>Title here!</title></head>
- <body>
- <?php
- session_start();
- global $status;
- echo 'session id is '.$status;
- ?>
- </body>
- </html>
any help greatly appreciated.