HTML submitting your <form> to a URL? Or Java
Hi, does anyone know this? How to submit form data to a URL? Or in Java. Doesn't have to be an URL, it can be anything that stores real data in.
I suggest you use Flask server.
<form action="/submit" method="post"> <input type="text" name="name" placeholder="Name"> </form>
@app.route('/submit', method=["GET","POST"]) def submit(): name = request.form.get("name") db[name] = value # doesn't matter, you saved the name onto db!
Add the action attribute to specify a URL. For example, take this form:
<form action="/page"> <input type="text" name="a-text-input"> <input type="submit" value="Submit"> </form>
Will send the following request to this URL when Hello is passed to the text input:
your repl url/page?a-text-input=Hello