[0T] Re: Simple python + html + from --> to python script

Steve Holden steve at holdenweb.com
Tue Oct 24 20:02:53 EDT 2006


Bruno Desthuilliers wrote:
> flit a écrit :
> 
>>Hello All,
>>
>>I am trying to get information from a form and send it to a python
>>script without success..
>>Here is my objective:
>>
>>User enters data in form --> form send variables to python script -->
>>script runs and output result.
> 
> 
> <OT topic="HTTP">
> If the script has side-effects (adding/updating/deleting database 
> records, writing files, etc), the script should not "output results", 
> but redirect to another url where the user can see these results.
> 
> Else - if the script doesn't have side-effects (ie :a search form, ...), 
> then the HTTP method should be "GET", not "POST".
> </OT>
> 
>>the form code
>>
>><form method="post" action="/cgi-bin/script.py" name="coord">Entre com
>>os dados <input name="data1"><br>
>>
>>Entre com os dados <input name="data2"><br>
>>Vai magraum <button name="submete"></button></form>
> 
> 
> <OT topic="HTML">
> button elements don't submit the form - they in fact don't do anything 
> unless you attach behaviour to them with javascript. What you want here 
> is an input type='submit'.
> 
> Also, the "button" tag doesn't require a end tag.
> 
> <form method="POST" action="/cgi-bin/script.py" name="coord">
> <label for="data1">Entre com os dados</label>
> <input type="text" name="data1" id="data1"><br>
> 
> <label for="data2">Entre com os dados </label>
> <input type="text" name="data2" id="data2"><br>
> Vai magraum <input type="submit" name="submete">
> </form>
> </OT>
> 
> (cf Steve's answer and the cgi module's doc for your problem)

So what problem were you talking about?

regards
  Steve
-- 
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC/Ltd          http://www.holdenweb.com
Skype: holdenweb       http://holdenweb.blogspot.com
Recent Ramblings     http://del.icio.us/steve.holden




More information about the Python-list mailing list