I'm a novice PHP user. I had just figured out how to do basic sessions under PHP4 when a harddrive crash forced me to re-install everything. I upgraded to PHP5, and now the scripts I had just "perfected" don't behave. In passing variables from script to script via the address bar, e.g.:
<a href='page2.php?myvar=whatever' >
I found that $myvar would be empty under PHP5, whereas its value was 'whatever' under PHP4. However, I was able to correct this by using
$_REQUEST["myvar"] within page2.php to retrieve the value.
Now that that's fixed, I find that my session variables are getting lost, too. Here is the code that runs at the top of each script:
session_start();
if (!session_is_registered('aAllImages')) { session_register( 'aAllImages') ;}
if (!session_is_registered('img_cat')) { session_register( 'img_cat') ;}
if (!session_is_registered('type')) { session_register( 'type') ;}
.... and so on.
Even if one of these variables is assigned a value in script1, it comes up empty in script 2. Why is this, and is there an easy fix so I don't have to re-write all my scripts? And, what happens when I upload this code to my hosting service which is running PHP4.4? How good is the backward compatibility?
Thank you for any help you can offer!