I know this may be trivial but I can't seem to figure out how to send user submitted data on my webpage to the server side. I am making a simple web app that takes in a users' word and then counts the number of syllables on the server side using Python
.
I render the page using flask:
@app.route('/')
def hello():
webPage = open('pg.html','r')
return webPage.read()
In JavaScript
I have a form
:
<form method="get"><br><br>
Enter a Word: <br>
<input type="text" name="name"><br><br>
<input type="submit" value="Submit">
</form>
When the user submits a word to this form, how do I retrieve it with Python
?
I've read around about GET
and POST
methods but I am still pretty confused.