HOME BLOG PORTFOLIO PHOTO CONTACT Admin Login
input type text in single variable many records storing php

<?php
//print_r($_REQUEST);
?>

<?php
if($_POST["submit"])
{
for($i=0;$i < $_POST["i"];$i++)
{
echo “<br>Inputed value $i =”.$_POST["name_".$i];
}
}
?>
<form name=”form1″ method=”POST”>
<?php
for($i=0;$i<10;$i++)
{
?>
<input type=”text” name=”name_<?php echo $i; ?>” />
<?php
}
?>
<input type=”hidden” name=”i” value=”<?php echo $i; ?>” />
<input type=”submit” name=”submit” value=”submit” />
</form>

output like:

Inputed value 0 =1111111
Inputed value 1 =222222222
Inputed value 2 =3333333333
Inputed value 3 =dslnsdklj
Inputed value 4 =5555
Inputed value 5 =jkhkllm
Inputed value 6 =7
Inputed value 7 =88
Inputed value 8 =99
Inputed value 9 =10

 

   Share on Facebook

Page views:813