Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transfert an array variable to another page without using a form

Status
Not open for further replies.

storm197

MIS
Oct 9, 2002
55
0
0
CA
Hi,

In a page, i'm using an array variable with multiple values.

Is there a way to transfert the entire variable values to another page without using a Form tag?

Can I put arrays in a session variable ?

Thank you.
 
You can put anything you want into a session variable.

You can also serialize the array and put it on the URL (if it isn't too big).

Or you can serialize the array and store it in a file (which is what sessions do for you) or store it in a MySQL database table.

Session are the way to go for what you want to do.

Ken
 
Ok, don't want to be too much dummie, but can you just show me a very short example on how you put arrays in session variables ?
 
In your first program:
Code:
<?
session_start();
$arr1 = array{'one','two','three');
$_SESSION['arr1'] = $arr1;
?>
In your second program:
Code:
<?
session_start();
$arr1 = $_SESSION['arr1'];
?>

Ken
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top