My form page and form handling page are below. I want the form handling page to display what the the user types in. There could be multiple values of name, url1 and url2. I want the foreach loop to loop through and display each value entered.
<form action = "insert.php" method="post">
<?php
$lectureNumber = 0;
$lecture= $HTTP_POST_VARS['lectureNum'];
$Number=1;
echo "<table width=800 border=0 cellpadding=3 cellspacing=2>\n";
while ($lectureNumber < $lecture)
{
echo "<tr>\n";
echo " <td width=10><b> $Number.</b></td><td width=270>Lecture Notes Name: <input type =text name=name[] ></td>
<td width=250>Postscript URL: <input type=text name=url1[] ></td>
<td width=220>PDF URL: <input type=text name=url2[] ></td>\n";
echo "</tr>\n";
$lectureNumber++;
$Number++;
}
echo "</table>\n";
?><p>
<?php
$lecturename=$HTTP_POST_VARS['name'];
$PostscriptURL=$HTTP_POST_VARS['url1'];
$PDFURL=$HTTP_POST_VARS['url2'];
foreach ($lecturename as $value And $PostscriptURL as $value2 And $PDFURL as $value3) {
echo "You entered the following information...<br>";
echo "Name of lecture added is : <b>$value</b></br>";
echo "Postscript URL is: <b>$value2</b></br>";
echo "PDF URL is: <b>$value3</b></br>";
}
?>