I am a newbie to PHP so you will have to fogive me if I say anything that does not make sense.
I have an .HTM file that contains a form with an input field called "FULLNAME". When I submit this form it POSTS to a PHP page called index.php. At the top of index.php I turn the input of the form into session a variable by doing the following:
session_start();
session_register('pass_author');
$pass_author = $HTTP_POST_VARS['FULLNAME'];
The index.php page continues processing and then loads a "required" called common.php. The reason this is important is because it also has "session_start();" as the first line because this file is used in other pages, and I thought it was an easy way to get to intialize the session so that the session variables would be available. After the required common.php line there is a header redirect to another PHP page called page2.php, which has the common.php loading as a required at the top of the page, which means that the "session_start();" happens again when this page loads.
I am using the following code to check to see if the session variable made it to page2.php:
if (!session_is_registered('pass_author')){
echo "The session was not registered";
exit();
}
else{
echo "The Session was registered";
exit();
}
The very first time that you submit the form the session variables do not seam to get created, but if I go back and resubmit the form everything seams to work just fine and the session variables are created and can be used on my other pages.
Please help if you can,
iMaCutlip