python is a Interpreted computer programming language. its very popular language for developing website and web application.
As we used form posting methods in earlier languages like asp classic 3.0 . there are two methods get and post here in python we only can use post method to post data to some other form. or within same form.
here is the python code to post form data.
html form
<html>
<body>
<h1>Form Page</h1>
<form method=GET>
<fieldset>
<legend>SAMPLE FORM</legend>
<ul>
<li>First Name: <input name='first'></li>
<li>Last Name: <input name='last'></li>
</ul>
<input type='submit' value='Submit Form'>
</fieldset>
</form>
</body>
</html>
python code :
from bottle import Bottle, template, request
app = Bottle()
@app.route('/')
def index():
"""Home Page"""
return template("form.tpl", message="Please enter your name")
No comments:
Post a Comment