1
$deposit=$_POST['amountdeposit'];
$arr= array();
for($i=0;$i<10;$i++)
{
    if($arr[$i]=='\0')
  { $arr[$i]= array("$deposit");
     }
     break;  
}
$page= "step2.php?arr=$arr";

    header("Location:$page");

?>

what i want to do is each time there's a change in $deposit , this value is stored in $arr[$i] and then it is passed in a url so that i could use GET on that step2.php page. What I see is just arr=array instead of values :/ please help me.

No Idea For Name
  • 11,411
  • 10
  • 42
  • 70
Aayush
  • 223
  • 1
  • 3
  • 13

2 Answers2

1

You want http_query_string. It will do exactly what you want.

Matt R. Wilson
  • 7,268
  • 5
  • 32
  • 48
0

A couple of other comments have recommended http_query_string, however I would use serialize along with urlencode.

Replace:

$page= "step2.php?arr=$arr";

with:

$page= "step2.php?arr=" . urlencode(serialize($arr));

Then when you get to step2.php, unserialize(urldecode($_GET['arr'])) will contain your array as you originally built it.

Nick Coons
  • 3,682
  • 1
  • 19
  • 21