Hi guys ...
I got a script that does some things and has the results in an array. when a user clicks a button, a new frameset has to be loaded; top is navigation and bottom content.
now, i need to pass the values of the array to the navigation.
first i pass the array via POST to the frameset.
there i call the navigation script with:
echo '<frame src="site.php?result="'.$_POST['result'].'" ...
unfortunately the value of $_GET['result'] in site.php (navigation) is "array" ... just the string, no real array ...
what can i do?
cookies and session variables are not an option here ...
Passing arrays ... I'm going nuts here ...
Moderator: General Moderators
-
Tubbietoeter
- Forum Contributor
- Posts: 149
- Joined: Fri Mar 14, 2003 2:41 am
- Location: Germany
-
pootergeist
- Forum Contributor
- Posts: 273
- Joined: Thu Feb 27, 2003 7:22 am
- Location: UK
an array is not a string therefore cannot be passed (in an unmanipulated) format through a query string.
the main way of getting round that is using serialize and unserialize to convert the array to a string and then back to an array
echo '<frame src="site.php?result=' .serialize($_POST['result']). '">';
then in site.php
result_array = unserialize($_GET['result']);
the main way of getting round that is using serialize and unserialize to convert the array to a string and then back to an array
echo '<frame src="site.php?result=' .serialize($_POST['result']). '">';
then in site.php
result_array = unserialize($_GET['result']);
parsing a serialzed string
are there functions to parse the serialzed string? or would I have to code one my self.