CGI and Redirect

  • Thread starter =?ISO-8859-2?Q?Grzegorz_=A6lusarek?=
  • Start date
?

=?ISO-8859-2?Q?Grzegorz_=A6lusarek?=

Hi All. I need to redirect user in my CGI script, i Try to use prin
"Location: "+url but this is not working. Can anyone tell me what I'm
doing wrong?
Any thanks will be apreciated
Gregor
 
G

Guest

Grzegorz said:
Hi All. I need to redirect user in my CGI script, i Try to use prin
"Location: "+url but this is not working. Can anyone tell me what I'm
doing wrong?
Any thanks will be apreciated

I guess you forgot to set the HTTP-Status. Either:

print "Status: 301" # Moved Permanently

or

print "Status: 302" # Moved Temporarily

HTH,

-- Gerhard
 
F

Fredrik Lundh

Grzegorz said:
Hi All. I need to redirect user in my CGI script, i Try to use prin
"Location: "+url but this is not working. Can anyone tell me what I'm
doing wrong?

something like

print "Status: 302"
print "Location: " + new_url
print
sys.exit(1)

should work (assuming that sys is imported, of course)

(if it doesn't, you have to define "not working")

hope this helps!

</F>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top