Problem with mod_python and send data with a form
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > Apache Mod-Python > Problem with mod_python and send data with a form




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Problem with mod_python and send data with a form  
David Bizier


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-18-06 06: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 se
e
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









[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 01:18 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register