cgi module FieldStorage() function not receiving arguments
<p>I am trying to get a Python cgi module to work.
Python file runs well, for example then I try to print out , but once it comes to recive a GET or POST argument the cgi.FieldStorage() function does not receive any input.
The print statement for FieldStorage output:</p>

<pre><code>FieldStorage(None, None, [])
</code></pre>

<p>You can find all the necessary code below. I have simplified my script to the bare minimum, trying to made it work.
It won't work either via GET nor POST.</p>

<pre><code>#!/usr/bin/env python


print "Content-type: text/html\n\n"
import cgi, cgitb
cgitb.enable()


form = cgi.FieldStorage() 

subMail = form.getfirst("mail")

print form
print subMail
</code></pre>

<p>The HTML page (nor POST nor GET are working)</p>

<pre><code>&lt;form action="cgi-bin/mail.py" method="post" id="frm-landingPage1" class="form"&gt;
&lt;div class="input-group"&gt;
&lt;input type="text" class="form-control" placeholder="Indirizzo email" name="mail" id="frm-landingPage1-email" required value=""&gt;
&lt;span class="input-group-btn"&gt;
&lt;input class="btn btn-default" type="submit" value="Invia" name="_submit" id="frm-landingPage1-submit"&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;/form&gt;
</code></pre>

<p>Make sure you have all pre-settings proper like CGI Environment and make sure the CGI Script is in correct path. Please read this: <a href="https://www.tutorialspoint.com/python/python_cgi_programming.htm" rel="nofollow">https://www.tutorialspoint.com/python/python_cgi_programming.htm</a></p>

python apache cgi