I have the following in a page e.g. /mypage?myvar=oldvalue
$_SESSION['myvar'] = $_GET['myvar']; $myvar = 'a_new_string'
Now $_SESSION['myvar'] has the value 'a_new_string'
Is this by design?
How can I copy the value of 'myvar' rather than a reference to it?
register_globals is the invention of the devil. Fortunately in PHP 6.0 it will be entirely disabled. It wasn’t just a huge security problem, it makes people confuse. Please turn it off in your php.ini using register_globals = Off More information: https://www.php.net/register_globals Also you can check the current settings with the command if (ini_get(register_globals)) echo "turn it off! :)’;