I've been learning HTML/PHP and MySQL over the past three days and have come unstuck on sessions under PHP.
My exact problem is that I receive an error that the "_SESSION" variable is undefined (I'm attempting to implement a login-system for my locally hosted website.)
It seems that the _SESSION variable is only available within the scope of a single PHP script, that or, cookies are not working as they should. For example, take the following two files;
Page1.php
Code: Select all
<SCRIPT language="php">
session_start();
$_SESSION["Username"] = "Win32";
</SCRIPT>Code: Select all
<SCRIPT language="php">
print($_SESSION["Username"]);
</SCRIPT>Maybe someone could shed some light on my problem? Thanks in advance.
P.S. I'm running an Apache 2.0 webserver and PHP 5.1.4
-Matt