Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%
- #Definimos una funcion para mostrar el formulario
- def formulario():
- %>
- <p>Envianos tus datos</p>
- <form method="post" action="formulario.psp">
- Nombre:<input type="text" id="nombre" name="nombre" />
- Apellidos:<input type="text" id="apellidos" name="apellidos" />
- <input type="submit" value="enviar" />
- </form>
- <%
- #end formulario
- %>
- <html>
- <body>
- <%
- #Comprobamos que nos llegan parametros de un formulario que esperamos
- if form.has_key('nombre') and form.has_key('apellidos'):
- #Comprobamos que estos parametros no llegan vacios
- if req.form['nombre'] != '' and req.form['apellidos'] !='':
- nombre = req.form['nombre']
- apellidos = req.form['apellidos']
- %>
- <h4>Hola <%=nombre +' '+ apellidos+'!!' %><h4>
- <%
- else:
- #Si los datos estan vacios mostramos el formulario
- formulario()
- else:
- #Si no existen datos del formulario mostramos el formulario
- formulario()
- #end if
- %>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement