I've been trying to get the data from an HTML file to a Python file, here is the HTML code. I tried CGI but I don't think it works for me. I don't know what to do or what to try.
<form class="login100-form validate-form" action="../backenddeneme/main.py" method="post">
<span class="login100-form-title">
User Login
</span>
<div class="wrap-input100 validate-input" data-validate = "Username is required">
<input class="input100" type="text" name="username" placeholder="Username">
<span class="focus-input100"></span>
<span class="symbol-input100">
<i class="fa fa-envelope" aria-hidden="true"></i>
</span>
</div>
<div class="wrap-input100 validate-input" data-validate = "Password is required">
<input class="input100" type="password" name="pass" placeholder="Password">
<span class="focus-input100"></span>
<span class="symbol-input100">
<i class="fa fa-lock" aria-hidden="true"></i>
</span>
</div>
<div class="container-login100-form-btn">
<button class="login100-form-btn" type="submit">
Login
</button>
</div>
<div class="text-center p-t-12">
<span class="txt1">
Forgot
</span>
<a class="txt2" href="#">
Username / Password?
</a>
</div>
<div class="text-center p-t-136"></div>
</form>
I tried this python code but when I click the submit button, a blank white page with my python code appears
import sqlite3
import cgi
form = cgi.FieldStorage()
username = form.getvalue("username")
password = form.getvalue("password")
conn = sqlite3.connect("users.db")
c = conn.cursor()
c.execute("SELECT * FROM users WHERE username='%s' AND password='%s'" % (username, password))
result = c.fetchall()
print(result)
conn.commit()
conn.close()