4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: hannes2000 on June 30, 2003, 11:31:29 PM
-
Hi.
Is it possible to store whole arrays (maybe even multidimensional arrays (eg. $myarray - [1])) with the 4images "site_sess->set_session_var(...)" function/object as session-variables???
TIA and best regards, Hannes
-
You need to little modifications in includes/sessions.php
In the set_session_var() function, add
$value = serialize($value);
after
global $site_db;
and in the get_session_var() function
$value['sessionvars_value'] = unserialize($value['sessionvars_value']);
after
if ($value) {
After that you can store all kind of data types.
Jan
-
Hi Jan.
Thanx, I did the mod but now the variables stored come back as e.g. s:5:"image"; , a variable I stored with
$site_sess->set_session_var("imagemode", $imagemode);
and fetched with
$imagemode = $site_sess->get_session_var("imagemode");
I haven't too much experience with the serialize/unserialize function of PHP, so is this usual? And do I have to extract my variable for my own from the string I got back?
TIA and regards, Hannes