Hi, been scratching my head and looking all over but cant get session data to pass to multiple pages.
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
---------------
On submit I call my second page which in reality would check username against database and assign either "member" or "nonmember" to session_id
Now I may navigate around the site a little but if I choose "downloads" I need to be able to read the session_id member or nonmember ?
Problem is that going to "download.p hp" produces no session_id ?
any help greatly appreciated.
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
---------------
Code:
<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>
Code:
<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>
Code:
<html> <head><title>Title here!</title></head> <body> <?php session_start(); global $status; echo 'session id is '.$status; ?> </body> </html>
any help greatly appreciated.
Comment