I try to send loop variable to another page with url and GET. but $_GET just only print the last value.
This My code now
...
//example
$codereg[0] = 6;
$codereg[1] = 2;
$codereg[2] = 67;
if ($option =='sent')
{
foreach($codereg as $ids)
{
header("location:checkout.php?id=$userId&productIds[]=$ids");
}
}
and this my checkout.php
<?php
$userId= $_GET['id'];
$code= $_GET['productIds'];
foreach($code as $test)
{
echo $test;
}
?>
some one help me fix my code or give better solution...