so here it is, first you will input how many textfield you have then click ok after clicking ok input the value in all the textfield after that if you click add you will see the sum of all the value in the textfield help pls
<html>
<head>
<title>Margz</title>
</head>
<form method="POST" action="">
<body>
<p>Number:
<label for="textfield"></label>
<input type="text" name="textfield" id="textfield" />
<input type="submit" name="button1" id="button1" value="OK" />
<input type="submit" name="button2" id="button2" value="ADD" />
</p>
</body>
</form>
<?PHP
function display ($x)
{
for($i=1;$i<=$x;$i++)
{
echo "Num " . $i ." ------------------ <br>";
?>
<input type="text" name=<?PHP echo $i;?>
<?PHP
echo "<br>";
echo "<br>";
}}
?>
<?PHP
if(isset($_POST['button1']))
{
display($_POST['textfield']);
}
if(isset($_POST['button2']))
{
}
?>
</html>