El usuario debe crear un Menú Desplegable o Select en HTML, que visualice los números del 1 al N como opciones, a través de una Sentencia Repetitiva, donde N es digitado por el usuario y capturado a través de un cuadro de texto.

Escriba el código que permita visualizar en el Select los números naturales del 1 al N (Límite).

Hola, Esta es mi respuesta, primero el codigo en html el cual es el del formulario
<html>
<head>
<title>Menu desplegable</title>
</head>
<body>
<form action=”menu.php” method=”POST”>
<h1><center>Select numeros naturales</center></h1>
<br>
<table width=”80%”>
<tr><th>Limite</th><td><input type=”text” name=”n1″></td></tr>
<tr><th><input type=”submit” name=”IN” value=”Visualizar”></th><th><input type=”reset” name=”bor” value=”Borrar”></th></tr>
</table>
</form>
</body>
</html>
Y este es el codigo de php que permite crear el select
<html>
<head>
<title>Menu desplegable</title>
</head>
<body>
<h1><center>Select numeros naturales</center></h1>
<?php
$h = $_POST[‘n1′];
echo “<h1><center>El limite es $h</center><h1>” ;
echo “<center><select><center>”;
for ($m = 1; $m <= $h; $m++) echo “<option value=’$m’>$m</option>”;
echo “<select>”;
?>
</body>
</hmtl>