On the first page (index.php) I wrote this:
<?php
echo '<form action="test.php" method="get">';
$x=0;
while($x<5){
$x++;
$test='tester'.$x;
echo '<input type="text" name="$test"><br>';
};
echo '<input type="submit" value="submit">';
?>
on the second page (test.php) I wrote this:
<?php
echo $_POST['tester1'];
echo $_POST['tester2'];
echo $_POST['tester3'];
echo $_POST['tester4'];
echo $_POST['tester5'];
?>
and when I tested it I got these errors
Notice: Undefined index: tester1 in C:\xampp\htdocs\test.php on line 2
Notice: Undefined index: tester2 in C:\xampp\htdocs\test.php on line 3
Notice: Undefined index: tester3 in C:\xampp\htdocs\test.php on line 4
Notice: Undefined index: tester4 in C:\xampp\htdocs\test.php on line 5
Notice: Undefined index: tester5 in C:\xampp\htdocs\test.php on line 6
The code below is an example for the real code being meant for users to fill in a number. I want to use these numbers later for calculations so they all need an unique name. The <input> objects are generated via a loop, the amount of times the loop runs is specified by the amount of rows in a database.
echo '<input type="text" name="'.$test.'"><br>';method="get", so they are passed in the URL instead over POST. Change it tomethod="POST". Apply both changes of what I commented, that should work.