471,357 Members | 1,090 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,357 software developers and data experts.

cgi

i have simple page and form that ask for name and color and cgi script that
print that name in another page and background in chosen color

all the time this error pop:
Error response

Error code 501.

Message: Can only POST to CGI scripts.

Error code explanation: 501 = Server does not support this operation.

i run it on windows xpand this is server that i use:

webdir = '.'
port = 80

import os, sys
from BaseHTTPServer import HTTPServer
from CGIHTTPServer import CGIHTTPRequestHandler

os.chdir(webdir)
srvraddr = ("", port)
srvrobj = HTTPServer(srvraddr, CGIHTTPRequestHandler)
srvrobj.serve_forever()

can someone help me?

thanks!
Aug 29 '07 #1
6 6119
Il Wed, 29 Aug 2007 19:24:54 +0200, Gigs_ ha scritto:
i have simple page and form that ask for name and color and cgi script
that print that name in another page and background in chosen color

all the time this error pop:
Error response

Error code 501.

Message: Can only POST to CGI scripts.
I think this should be your problem,

change GET with POST in the form

bye
Aug 29 '07 #2
Fabio Z Tessitore wrote:
Il Wed, 29 Aug 2007 19:24:54 +0200, Gigs_ ha scritto:
>i have simple page and form that ask for name and color and cgi script
that print that name in another page and background in chosen color

all the time this error pop:
Error response

Error code 501.

Message: Can only POST to CGI scripts.

I think this should be your problem,

change GET with POST in the form

bye
it is post in form.
Aug 29 '07 #3
Are you sure your script is in the right dir?

On my home computer, php script will work in /var/www but my python
script need an other dir to work properly (i don't remember which now ;-))

bye

Aug 29 '07 #4
Fabio Z Tessitore wrote:
Are you sure your script is in the right dir?

On my home computer, php script will work in /var/www but my python
script need an other dir to work properly (i don't remember which now ;-))

bye
i think that it is in right dir because other script in same dir work.
dir is: cgi-bin
Aug 29 '07 #5
Gigs_ wrote:
Fabio Z Tessitore wrote:
>Are you sure your script is in the right dir?

On my home computer, php script will work in /var/www but my python
script need an other dir to work properly (i don't remember which now
;-))

bye
i think that it is in right dir because other script in same dir work.
dir is: cgi-bin

sorry...................

for waisting your time,
somehow in html page in form i forgot to put right script addr

thx anyway
work now
Aug 29 '07 #6
Il Wed, 29 Aug 2007 23:11:53 +0200, Gigs_ ha scritto:
Gigs_ wrote:
>Fabio Z Tessitore wrote:
>>Are you sure your script is in the right dir?

On my home computer, php script will work in /var/www but my python
script need an other dir to work properly (i don't remember which now
;-))

bye
i think that it is in right dir because other script in same dir work.
dir is: cgi-bin


sorry...................

for waisting your time,
somehow in html page in form i forgot to put right script addr

thx anyway
work now
no prob, bye
Aug 29 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by William C. White | last post: by
2 posts views Thread by Albert Ahtenberg | last post: by
3 posts views Thread by James | last post: by
reply views Thread by Ollivier Robert | last post: by
1 post views Thread by Richard Galli | last post: by
4 posts views Thread by Albert Ahtenberg | last post: by
1 post views Thread by inderjit S Gabrie | last post: by
2 posts views Thread by Jack | last post: by
3 posts views Thread by Sandwick | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.