Hi,
I'm trying to find a way to keep array contents static (i.e. retained) thru multiple page loads/refreshes. From what I can tell, sessions might be the way to go. The examples I've seen so far show sessions as a way to transfer array contents across different pages. My question: Can sessions be used to retain array contents (i.e. not have the array re-initialize) upon a single page reload/refresh ? Any examples of such...?
Thanks,
John
Sessions question
Moderator: General Moderators
-
d3ad1ysp0rk
- Forum Donator
- Posts: 1661
- Joined: Mon Oct 20, 2003 8:31 pm
- Location: Maine, USA
Code: Select all
<?PHP session_start();
$_SESSION['var'] = $pagevar; ?>
<html>
<body>
<?PHP echo "$pagevar"; ?>
</body>
</html>Code: Select all
<?php
for(int i=0;i<num;i++)
{
$_SESSION['something[i]'] = $something[i];
}
?>that would save all the array variables to session variables