Hey all,
I've got a question for you all. I would like to repeat a form a number of times based on what the user filled out in a form on the previous page.
This is the first coding page:
selecttravel.php
<html>
<body>
<form method="post" action="definetrip.php">
<h4>Will the trip include one or more stop-overs?</h4>
<table>
<tr>
<td>No</td>
<td> <input type="radio" name="numberofstops" value="0" checked> </td>
</tr>
<tr>
<td> Yes, </td>
<td> 1 stop</td>
<td> 2 stops</td>
<td> 3 stops</td>
<td> 4 stops</td>
<td> 5 stops</td>
</tr>
<tr>
<td> </td>
<td> <input type="radio" name="numberofstops" value="1"> </td>
<td> <input type="radio" name="numberofstops" value="2"> </td>
<td> <input type="radio" name="numberofstops" value="3"> </td>
<td> <input type="radio" name="numberofstops" value="4"> </td>
<td> <input type="radio" name="numberofstops" value="5"> </td>
</tr>
</table>
</body>
</html>
the definetrip.php page I'm currently looking at is the following:
<html>
<head><title>Definition of the trip</title></head>
<body>
<table width="650">
<tr>
<td width="250">Please select the stopover:</td>
<td><select name="transit" size="1">
<?
$result=mysql_query("SELECT name, country FROM cities.cities");
$row = mysql_fetch_array($result);
while ($row) {
?>
<option value="<?print($row['name']);?>"><?print($row['name']);?>
<?
$row = mysql_fetch_array($result);
}
?>
</select><br></td>
<br>
</tr>
</table>
</body>
</html>
I tried to include the whole table in some while functions (I mean "while ($numberofstops>0, and so on...)") but never had any result that even came close to what I wanted to obtain.
Anyone having an idea on how to get me closer to what I'd like to do?
Thanks in advance for your tips!