I have created html form with text box and button
enter ur search keyword
My requirement is to pass the text box value in to my test.py code, is there any way to do it. Please suggest me how do it.
in the form action form action=""
, put the location of your cgi script and the value of the textbox will be passed to the cgi script.
eg.
<form name="search" action="/cgi-bin/test.py" method="get">
Search: <input type="text" name="searchbox">
<input type="submit" value="Submit">
</form>
in your test.py
import cgi
form = cgi.FieldStorage()
searchterm = form.getvalue('searchbox')
thus you will get the key word entered in search text box in searchterm variable in python.