By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,984 Members | 2,832 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,984 IT Pros & Developers. It's quick & easy.

how send array to other page in URL??

P: n/a
hi all...

i have array and iwant this array to other page in URL

let the name of array is numbers and i fill this array by loop from
data base

when i write this ..
echo "<META HTTP-EQUIV=\"refresh\" content=\"0; URL=reg.php?arr=
$numbers \"";

when redirect to reg page the url is
http://localhost/reg.php?arr=Array

and when print the variable $arr in reg page apeare Arrary word

so ,please tell me how i can send the array ??

thanks.
Jan 6 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Sun, 06 Jan 2008 23:39:46 +0100, suma <su*****@hotmail.comwrote:
hi all...

i have array and iwant this array to other page in URL

let the name of array is numbers and i fill this array by loop from
data base

when i write this ..
echo "<META HTTP-EQUIV=\"refresh\" content=\"0; URL=reg.php?arr=
$numbers \"";

when redirect to reg page the url is
http://localhost/reg.php?arr=Array

and when print the variable $arr in reg page apeare Arrary word

so ,please tell me how i can send the array ??
serialize()/implode() and on the receiving page unserialize()/explode()
it, or use a session ans store it in that, and never use a META refresh
when you can send a real redirect header ( header('Location:
../reg.php?arr='.urlencode(implode(';',numbers))); )
--
Rik Wasmus
Jan 6 '08 #2

P: n/a
suma wrote:
hi all...

i have array and iwant this array to other page in URL

let the name of array is numbers and i fill this array by loop from
data base

when i write this ..
echo "<META HTTP-EQUIV=\"refresh\" content=\"0; URL=reg.php?arr=
$numbers \"";

when redirect to reg page the url is
http://localhost/reg.php?arr=Array

and when print the variable $arr in reg page apeare Arrary word

so ,please tell me how i can send the array ??

thanks.
You have to send each individual element of the array. Alternatively,
you could serialize the array then urlencode it. But that can result in
large amounts of data if your array is big - maybe too much data.

You could store the contents of the array in the $_SESSION variable, but
again, if it's a lot of data this can slow you down. And if it is a lot
of data, you probably should be refetching the data from the database,
anyway.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Jan 6 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.