denhamd2 Posted April 6, 2007 Share Posted April 6, 2007 Hi, In my first page I passed variables to my second page and I stored them as session variables of the same name in my 2nd page. However in my 3rd page I want to echo all the session variables I stored in the 2nd page. Any idea on how to do this? Here is my code in the 2nd page for storing the session variables... <?php // This will set all your get varibles to session with same name in get $un_nec_varible = array('monthsubmit','anyother'); if(isset($_GET)){ foreach($_GET as $key => $value){ if(!in_array($key,$un_nec_varible)){ $_SESSION["DATA"][$key] = $value; echo "<li>".$value."</li>"; } } } ?> Link to comment https://forums.phpfreaks.com/topic/45860-printing-all-stored-session-variables/ Share on other sites More sharing options...
PC Nerd Posted April 6, 2007 Share Posted April 6, 2007 im, i dont know, but i know that you can use the function in my other thread http://www.phpfreaks.com/forums/index.php/topic,134786.0.html. tjhis only works on the same page i think..... good luck Link to comment https://forums.phpfreaks.com/topic/45860-printing-all-stored-session-variables/#findComment-222799 Share on other sites More sharing options...
trq Posted April 6, 2007 Share Posted April 6, 2007 <?php session_start(); foreach($_SESSION['DATA'] as $v) { echo "$v<br />"; } ?> Link to comment https://forums.phpfreaks.com/topic/45860-printing-all-stored-session-variables/#findComment-222804 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.