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/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to