I have a php file called process.php that sets a session variable, namely $_SESSION['transtype']. This page also contains a form that is submitted to final.php.
If I echo the value of $_SESSION['transtype'] at the end of the process.php file, it displays the correct value. However, in final.php, it is no longer set.
In final.php I have the following snippet of code. The output of this page is "Not set." Why is the value of 'transtype' being lost between these 2 pages?
The session_start() function should throw an error, because you have output data to the browser before starting the session. Try putting session_start() at the beginning of the document, before you put any HTML code.
Visit Slightly Remarkable to see my portfolio, resumé, and consulting rates.
Bookmarks