I’m trying to make a login page, but i can’t get sessions to work. I’ve tried many different ways of doing it:
session_register
$_SESSION[‘variable’]
$HTTP_SESSION_VARS[‘variable’]
but it just don’t work. I created a miniture script just to test it and even that don’t work. Here it is:
PAGE 1
<? session_start ();
$_SESSION[‘variable’]=”hello”;
?>
<html>
<head>
<title>Test Page 1</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
</head>
<body>
<a href =”page2.php”>page 2</a>
</body>
</html>
page 2
<? session_start (); ?>
<html>
<head>
<title>Test Page 2</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
</head>
<body>
<?
print $_SESSION[‘variable’];
?>
</body>
</html>
Now is there something wrong with that or is there something else i need to do? Also is using Apache on my comp as a testing ground anything to do with it? I can’t see why but it did occur to me…
thanks