I did not include a dollar sign when I registered the variable, i know it has registered as it works in all my other scripts. I have even tried copying the initial code from my other, working scripts to no avail. Here is a snippet of code from the "non-working" script:
<?
session_start();
?>
<?
//connects to database here, all works.
$result = mysql_query("select * FROM users WHERE Username = '$valid_user'");
$array = mysql_fetch_array($result);
?>
If i replace $valid_user with an actual username the script works.
So i know that the session variable is not working properly, but it is in other scripts using identical code!