0

Trying to build my own webmail client. I get a template for the web part which look like this

<form name="input" action="test2.py" methog="get" class="form">
 <input type="text" name="Username" placeholder="Username">
 <input type="password" name="Pass" placeholder="Password">
 <button type="submit" id="login-button">Login</button>
</form>

Would like to get the input on click on the button of Username && Pass via GET method to fill this bunch of code in python.

user = ???(Username)
pass = ???(Pass)

And print to a new empty html file the value of thoses var.

New to python so everything I try seem to fail.

asked Jun 20, 2015 at 17:17
3
  • docs.python.org/2/library/cgi.html#using-the-cgi-module Commented Jun 20, 2015 at 17:23
  • Excatly what I did... but seem not working on click. Do I need some Js behind ? Commented Jun 20, 2015 at 19:54
  • I don’t think so.. could you paste your current python code here? Commented Jun 21, 2015 at 5:38

2 Answers 2

1

You should use method="post", it won't work with a GET method (however it is misspelled, you wrote "methog").

answered Aug 30, 2015 at 21:10
Sign up to request clarification or add additional context in comments.

Comments

0

Write import request without quotes at the top of your python file. Now use request.inputForm['name'] without quotes to access form elements where name is the element name.

mx0
7,34312 gold badges57 silver badges57 bronze badges
answered Nov 7, 2018 at 22:47

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.