note 676 deleted from function.serialize by sniper

From: Date: Tue, 23 Sep 2003 22:40:22 +0000
Subject: note 676 deleted from function.serialize by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-57008@lists.php.net to get a copy of this message
Note Submitter: cmv@easyDNS.com ---- Based on my experience: If you are storing serialized data in a database, you need to serialize() the data, *then* addslashes(), then stick it in the DB. When you pull it out, stripslashes() (if you don't automatically do it), then unserialize(). If you are passing serialized data between pages in hidden form fields, you need to serialize() the data, then *urlencode()* it, then put it in the hidden field. When you get to the next page, urldecode() it, then unserialize(). If you are passing serialized data in a query string, you don't need to urldecode() it on the following page. Just unserialize().

« previous php.notes (#57008) next »