Global Variables Question from a newbie :(
Posted: Sat Oct 06, 2007 2:18 pm
Hi all,
Please excuse my ignorance. I am not very good with PHP and only seldom practice but I have a problem. I understand PHP has been upgraded and this has led to some problems with my scripts. I used to globalise variables using session_register() but now that doesn't work !! I have researched and tested but can't find an alternative method. Even the $_session[] isn't working on my scripts. I just need to transfer variables across scripts.
Here I have two scripts as follows...
page1.php
This would pass the variable contents to page2.php....
But now it doesn't work. Can someone tell me how to pass the content of $test please
))??
Larry.
Please excuse my ignorance. I am not very good with PHP and only seldom practice but I have a problem. I understand PHP has been upgraded and this has led to some problems with my scripts. I used to globalise variables using session_register() but now that doesn't work !! I have researched and tested but can't find an alternative method. Even the $_session[] isn't working on my scripts. I just need to transfer variables across scripts.
Here I have two scripts as follows...
page1.php
Code: Select all
<?php
session_start ();
session_register(test);
$test = "hello";
echo "<p><a href=\"page2.php\">Go to Page 2</a></p>";
?>Code: Select all
<?php
session_start ();
echo "test=$test <br>";
echo "<p><a href=\"page1.php\">Go to Page 1</a></p>";
?>Larry.