You are here: Re: Cookies.. Serialize/Unserialize.. « PHP Programming Language « IT news, forums, messages
Re: Cookies.. Serialize/Unserialize..

Posted by Janwillem Borleffs on 11/16/06 11:29

onefastmustang wrote:
> Neva mind.. I figured it out.. I had to add stripslashes to this line.
>
> $searchdata = unserialize(stripcslashes($_COOKIE['searchdata']));
>

If you would define the array before assigning values to and serializing it,
you will see that it also works without stripcslashes():

$searchdata = array();
$searchdata['state'] = 'Foo';
$searchdata['country'] = 'Bar';
$searchdata['radius'] = 100;
$searchdata['radius_zip'] = 1000;
$s = serialize($searchdata);
$searchdata = unserialize($s);
print_r($searchdata);


JW

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация