Apache Mod-Python - Problem with mod_python and send data with a form

This is Interesting: Free IT Magazines  
Home > Archive > Apache Mod-Python > August 2006 > Problem with mod_python and send data with a form





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Problem with mod_python and send data with a form
David Bizier

2006-08-18, 1:13 pm

Hi,

I'm a beginner with mod_python and Python (also with english langage,
sorry). I tried some exemple code and all works fine!

Unfortunately, I have a problem to send data with a form (POST ou GET) to a
..py script file. When I try to send data to my .py file, with Firefox, I see
a blank page, without text or error message.

Here is my form (export.php):

------------------
<html>
<body>
<FORM name="frm1" action="scripts/python/toto.py/say" method="POST">
<TABLE>
<TR>
<TD>First Name: </TD>
<TD><INPUT type="text" name="firstname" value="Bob"></TD>
</TR>
<TR>
<TD colspan="2" align="center"><INPUT type="submit" value="Go"></TD>
</TR>
</TABLE>
</FORM>
</body>
</html>
--------------------

And here is my Python page (toto.py):

-------------------
from mod_python import apache
from mod_python import util

def say(req, firstname="NOTHING"):
req.content_type = "text/html"
return "I am saying %s" % firstname
-------------------

I have found a apache config file, on my server, with these lines:

"...
<IfModule mod_python.c>
<Files ~ (\.py$)>
SetHandler python-program
PythonHandler mod_python.cgihandler
</Files>
</IfModule>

"...'

</Directory>

<Directory /var/www/vhosts/monSiteWeb.com/httpdocs/scripts/python>
Options -Indexes FollowSymLinks MultiViews
AllowOverride All
AddHandler mod_python .py
PythonHandler mod_python.publisher
PythonDebug On
</Directory>

Thanks for your help! I would like to find an answer shortly to continue my
project!

Regards,
David




Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com