PHP Example
Screen shot
Screen shot
Screen shot
Index.php

<html>
<head>
<title>php example</title>
</head>
<body>
<form name=\"frm\" action=\"qty.php\" method=\"post\">
Enter No of Item<input name=\"no_of_item\" type=\"text\"><br>
<input name=\"btn\" type=\"submit\" value=\"submit\">
</form>
</body>
</html>

qty.php

<html>
<head>
<title>php example</title>
</head>
<body>
<form name=\"frm\" action=\"submit.php\" method=\"post\">
<?php
if(isset($_POST[\'btn\']))
{
$count=$_POST[\'no_of_item\'];
for($i=0;$i<$count;$i++)
{
?>
Enter Item Qty <?php echo $i+1; ?><input name=\"qty[]\" type=\"text\"><br>
<?php
}
}
?>
<input name=\"btn\" type=\"submit\" value=\"Submit\">
</form>
</body>
</html>

submit.php

<?php
if(isset($_POST[\'btn\']))
{
$count=count($_POST[\'qty\']);
for($i=0;$i<$count;$i++)
{
echo 1+$i.\" Item Qty \".$_POST[\'qty\'][$i].\"<br>\";
}
}
?>

You can download source code here