...

View Full Version : How to send array from one form to another?



ramki067
02-22-2008, 03:52 AM
Hi,
I've an array $streams[] and i need to send this array to next page on submit button click. I'm trying to capture this array in the next page but with no luck, need help in this matter. Please



<form name="stream_selection" enctype="multipart/form-data" method="post" action="selected_streams.php">


<input name=streams type=hidden value=$streams[]>

Receiving the array in the next page as follows:


$stream[]=$_REQUEST['streams'];
for($i=0;$i<1000;$i++)
{
echo "$stream[i]<br>";

}


A blank page is displayed!


Thanks,
Ramki.

o0O0o.o0O0o
02-22-2008, 05:34 AM
<input name=streams type=hidden value=$streams[]>

Is this statement inside the php tags if not use


echo "<input name=streams type=hidden value=$streams>";

shyam
02-22-2008, 06:26 AM
is $streams an array in php? then u gotta use


foreach ($streams as $s) {
echo '<input name="streams[]" type=hidden value="' . $s . '">';
}

ramki067
02-22-2008, 07:17 AM
is $streams an array in php? then u gotta use


foreach ($streams as $s) {
echo '<input name="streams[]" type=hidden value="' . $s . '">';
}

Thanks Shyam. How to access on the receiving page?

/Ramki



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum