I got these two so far. Go through form.php, choose 2 or 3 then press the first submit. Enter image name, Enter link, Enter comment for all fields. then submit.
Now notice that only the last field that you have filled out only shows. Why is that ?
Form
<?php
if (!isset($_POST['submit']))
{
echo '
<form action="" method="POST">
How many input boxes would you like?<br>
<select name="number">
';
for ($i = 1; $i <= 10; $i++)
{
echo '<option>' . $i;
}
echo '
</select><br>
<input type="submit" name="submit" value="submit">
</form>
';
}
else
{
for ($i = 1; $i <= $_POST['number']; $i++)
{
echo $i . '.<br>';
echo '
<form action="output.php" method="post" >
<td width="5%">Image</td>
<td width="16%"> <input type="text" name="imagename"></td>
<td width="4%">Link</td>
<td width="16%"><input type="text" name="filelink"></td>
<td width="7%">comments</td>
<td width="52%"> <TEXTAREA NAME="comments" COLS=50 ROWS=1 WRAP=VIRTUAL></TEXTAREA>
</td>
<BR><BR>
';
}
}
echo '<input type="submit" name="Submit" value="Submit">
<input name="Reset" type="reset" id="Reset" value="Reset">';
?>
</form>
output
<?
$filename = $_POST["imagename"];
$filelink = $_POST["filelink"];
$comments = $_POST["comments"];
?>
<!-- end PHP -->
<html>
<head>
<title>output</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<br>
<? echo $imagename; ?> <br>
<? echo $filelink; ?> <br>
<? echo $comments; ?> <br>
</p>