PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
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.
<?php
session_start();
$_SESSION['session_var'] = 'This is some session var';
?>
I have also posted (within my last 10 posts I'd say) a brief sessions test codebase. You may want to look for that to get a decent way of starting a session, adding session vars, clearing session vars and ending a session.
Everah, I have amended the pages with $_session but the data does not 'stick'. Am I doing something wrong? On page1.php the output is empty and not passed to page2.php ??
On a side note, what you were doing before would have worked if register_globals was on. It is better for your that it is not on though, so make sure to always use the superglobal arrays $_GET, $_POST, $_COOKIE, $_SESSION, $_FILES, etc.