I have a form in a loop that iterates 4 times. I want to process and print the form data dynamically.
This is not showing the required output. Am I doing something wrong ?
index.php
<?php
for($i = 1; $i<5; $i++)
{
?>
<form action = 'index.php' method = 'post'>
<input type = 'text' name = 'name<?php echo $i; ?>'>
<?php
}
?>
<input type = 'submit' value = 'submit'>
<?php
for($i = 1; $i<5; $i++)
{
$namee = $_POST['name.$i'];
echo $namee;
}
?>