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.

1

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

Comments

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.