I have two php pages:
1)
<form method=post action="page2.php">
<input type=hidden name=a1 value=1 onclick="cal()">
<input type=hidden name=a2 value=2 onclick="cal()">
....
<input type=hidden name=a100 value=100 onclick="cal()">
2)on php2.php:
I can retrieve those data by using
$a1=$_POST['a1'];
...
$a100=$_POST['a100'];
Now I want to use FOR statement to get the data:
for ($i=1;$i<=100;$i++)
$a[$i]=$_POST['a'+$i]; ???this is not correct, I don't know how to get those data.
I know I can use array in form in 1st page, such as <input type=hidden name=a[1] value=1 onclick="cal()">
but it doesn't work in javascript, so I have to use variable a1, a2...a100, but have no idea how to get it on page2.php
Anybody can help me? thanks in advance.
1)
<form method=post action="page2.php">
<input type=hidden name=a1 value=1 onclick="cal()">
<input type=hidden name=a2 value=2 onclick="cal()">
....
<input type=hidden name=a100 value=100 onclick="cal()">
2)on php2.php:
I can retrieve those data by using
$a1=$_POST['a1'];
...
$a100=$_POST['a100'];
Now I want to use FOR statement to get the data:
for ($i=1;$i<=100;$i++)
$a[$i]=$_POST['a'+$i]; ???this is not correct, I don't know how to get those data.
I know I can use array in form in 1st page, such as <input type=hidden name=a[1] value=1 onclick="cal()">
but it doesn't work in javascript, so I have to use variable a1, a2...a100, but have no idea how to get it on page2.php
Anybody can help me? thanks in advance.