
Originally Posted by
Mittineague
If the form is the POST method, arrays like
<input name="array_name[]" ...
are passed to the "action" file as $_POST['array_name']
Thanks. But i'm using javascript to send an array to next page. But i'm unable to access the array in the next page. Infact, i've even given an alert just before the href line as shown below but the alert never executes. What could be the reason?
Code:
function check()
{
alert('1');
var frm=document.forms.stream_selection
sel_num = new Array();
Parr = new Array();
for(j=1;j<=500;j++)
{
if(!frm[j].checked)
{
frm[0].checked=false
}
else
{
Parr.push(j);
}
}
alert('3');
ParrStr=Parr.join(',');
location.href="selected_streams.php?arr="+ParrStr;
}
and in retreiving form my code is :
Code:
$sel_numbers=$_POST['arr'];
$sel_num=split(",", $sel_numbers);
//$sel_num = explode(" ", $sel_numbers);
$i=0;
while ($i < count($sel_num))
{
//echo "$all_streams[$i]<br>";
echo "$sel_num[$i]<br>";
$i++;
}
Thanks,
Ramki.
Bookmarks