[PHP] array into another site
Hi I have an PHP array and want to send it into another PHP site. $arr = array(251,1,23,54,15,135,1651,156,13,123,321,123,32,54,654,456,32,1); ? script language=JavaScript type=text/javascript a href=\javascript: void(vindu2 = window.open('view.php?arr=?$arr;?','windowname','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=850, height=700')); vindu2.focus();\View/a /script Anybody knows how to do this? Fred -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] array into another site
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... Justin French on 25/03/03 8:50 PM, Fredrik ([EMAIL PROTECTED]) wrote: Hi I have an PHP array and want to send it into another PHP site. $arr = array(251,1,23,54,15,135,1651,156,13,123,321,123,32,54,654,456,32,1); ? script language=JavaScript type=text/javascript a href=\javascript: void(vindu2 = window.open('view.php?arr=?$arr;?','windowname','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=850, height=700')); vindu2.focus();\View/a /script Anybody knows how to do this? Fred -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] array into another site
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