Re: array into another site

From: Date: Tue, 25 Mar 2003 10:46:35 +0000
Subject: Re: array into another site
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-140932@lists.php.net to get a copy of this message
At 11:21 25.03.2003, Justin French said: --------------------[snip]-------------------- >1. Missing an equal sign: <?=$ not <?$ >window.open('view.php?arr=<?=$arr;?>','windo... > > >2. Check out serialize() >http://www.php.net/manual/en/function.serialize.php > >window.open('view.php?arr=<?=serialize($arr)?>','windo... > > >3. However, this creates a URL which isn't particularly URL friendly (not >sure, but perhaps maybe not even valid -- I don't know), so.... > > >4. based on your array's size, I'd just implode() it, and then explode() it >back out on the new site: > >window.open('view.php?arr=<?=implode('-',$arr)?>','windo... --------------------[snip]-------------------- In both cases (serialize, and implode) you should urlencode the results: window.open('view.php?arr=<?=urlencode(serialize($arr))?>','windo... window.open('view.php?arr=<?=urlencode(implode('-',$arr))?>','windo... Should make for a valid URL then. However don't forget that passing application data via URL could pose a security risk to your application, depending on what the data actually represents, and how it is worked on. Consider also that URLs have some size limit (don't have the number at hand). -- >O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/

« previous php.general (#140932) next »