与textarea的python cgi问题 [英] python cgi problem with textarea

查看:55
本文介绍了与textarea的python cgi问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能比Python更像是一个cgi的东西,但我正试图在这个页面上获得



http://adrian10.phpwebhosting.com/trial.html


基本上包括:


< FORM ACTION =" /cgi-bin/python3.cgi" METHOD =POST>

< TEXTAREA NAME =" essay" COLS = 60 ROWS = 20 WRAP = HARD>< / TEXTAREA>

< P>< INPUT TYPE = SUBMIT VALUE =" submit" NAME =" submitbutton">

< / FORM>


....用这个cgi脚本打印出textarea的内容:


#!/ usr / bin / python

import cgi

print" Content-type:text / html \ n"

form = cgi.FieldStorage()

打印表格[" essay"]。值


... 。如果我在

textarea中有任何空格,我会收到内部服务器错误,这实际上会限制它对我的用处。奇怪的是,

它似乎适用于英国的一位看过它的朋友,但它对我来说在日本并不适合我。

This may be more a cgi thing than a Python one, but I''m trying to get
this page:

http://adrian10.phpwebhosting.com/trial.html

consisting basically of this:

<FORM ACTION="/cgi-bin/python3.cgi" METHOD="POST">
<TEXTAREA NAME="essay" COLS=60 ROWS=20 WRAP=HARD></TEXTAREA>
<P><INPUT TYPE=SUBMIT VALUE="submit" NAME="submitbutton">
</FORM>

....to print out the contents of the textarea with this cgi script:

#!/usr/bin/python
import cgi
print "Content-type: text/html\n"
form = cgi.FieldStorage()
print form["essay"].value

....and I get an internal server error if I have any spaces in the
textarea, which is really going to limit its usefulness to me. Oddly,
it seems to work for a friend in the UK who''s looked at it, but it
doesn''t work for me here in Japan.

推荐答案

4月22日下午4:08,Adrian Smith< adrian_p_sm ... @ yahoo.comwrote:
On Apr 22, 4:08 pm, Adrian Smith <adrian_p_sm...@yahoo.comwrote:

这可能比Python更像是一个cgi的东西,但是我想在这个页面上获得


http://adrian10.phpwebhosting.com/trial.html


基本上包括:


< FORM ACTION =" /cgi-bin/python3.cgi" METHOD =POST>

< TEXTAREA NAME =" essay" COLS = 60 ROWS = 20 WRAP = HARD>< / TEXTAREA>

< P>< INPUT TYPE = SUBMIT VALUE =" submit" NAME =" submitbutton">

< / FORM>


...用这个cgi脚本打印出textarea的内容:


#!/ usr / bin / python

import cgi

print" Content-type:text / html\\\
" ;

form = cgi.FieldStorage()

打印表格[" essay"]。值


......和如果我在

textarea中有任何空格,我会收到内部服务器错误,这实际上会限制它对我的用处。奇怪的是,

它似乎适用于英国的一位看过它的朋友,但是它b $ b在日本并不适合我。
This may be more a cgi thing than a Python one, but I''m trying to get
this page:

http://adrian10.phpwebhosting.com/trial.html

consisting basically of this:

<FORM ACTION="/cgi-bin/python3.cgi" METHOD="POST">
<TEXTAREA NAME="essay" COLS=60 ROWS=20 WRAP=HARD></TEXTAREA>
<P><INPUT TYPE=SUBMIT VALUE="submit" NAME="submitbutton">
</FORM>

...to print out the contents of the textarea with this cgi script:

#!/usr/bin/python
import cgi
print "Content-type: text/html\n"
form = cgi.FieldStorage()
print form["essay"].value

...and I get an internal server error if I have any spaces in the
textarea, which is really going to limit its usefulness to me. Oddly,
it seems to work for a friend in the UK who''s looked at it, but it
doesn''t work for me here in Japan.



我刚尝试过它的工作原理。这是

http: //yallara.cs.rmit.edu.au/~bevcimen/form.html


可能内部服务器错误是因为mod_python没有安装

假设你使用Apache作为你的网络服务器


干杯

i just tried it and its working. here it is

http://yallara.cs.rmit.edu.au/~bevcimen/form.html

maybe the internal server error is because mod_python isn''t installed
assuming your using Apache as your web server

Cheers


4月22日凌晨2:08, Adrian Smith< adrian_p_sm ... @ yahoo.comwrote:
On Apr 22, 2:08 am, Adrian Smith <adrian_p_sm...@yahoo.comwrote:

...如果我在
中有任何空格,我会收到内部服务器错误
textarea,
...and I get an internal server error if I have any spaces in the
textarea,



服务器错误日志中出现什么错误?

And what error appears in the server error log?


4月22日晚上10点10分,平静的< Bul ... @ gmail.comwrote:
On Apr 22, 10:09 pm, placid <Bul...@gmail.comwrote:

i刚尝试过它的工作原理。这是

http: //yallara.cs.rmit.edu.au/~bevcimen/form.html


可能内部服务器错误是因为mod_python没有安装

假设您使用Apache作为您的网络服务器
i just tried it and its working. here it is

http://yallara.cs.rmit.edu.au/~bevcimen/form.html

maybe the internal server error is because mod_python isn''t installed
assuming your using Apache as your web server



是的,但在这种情况下它根本不起作用*,不是吗? ATM它

似乎只要textarea输入没有空格就可以工作。

Yeah, but it wouldn''t work *at all* in that case, would it? ATM it
seems to work as long as the textarea input has no spaces.


这篇关于与textarea的python cgi问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆