Redirecting broswers in Py

Andrew Markebo flognat at flognat.myip.org
Wed Jul 25 17:21:12 EDT 2001


First of all, a hint.. you can use """ or ''' or ' to surround
strings, so you could do:

c.send("""<META HTTP-EQUIV="Refresh"Content=0;Host="http://www.someurl.com">""")

Hmm reading this example you seem to be missing a ; between refresh
and content, could be a 'news' bugg.

Are you only sending this answer?? as reply? You know that you need to
send status back also with headers and so on, like 

HTTP/1.0 200 ok
[headers]
[empty line]
[HTML containting your redirection]

An alternative could be to send a "HTTP/1.0 302 Redirect" answer to
the browser, including as header the location to move to.

        /Andy


/ Adonis Vargas <deltapigz at telocity.com> wrote:
| the script accepts the connection then processes information once that
| is done i want to be able to send the broswer to X page. i have found
| something and used it in the line below:
| 
| c.send("<META
| HTTP-EQUIV=\"Refresh\"Content=0;Host=\"http://www.someurl.com\">")
| 
| but i think im going at this completely wrong.
| 
| any help would greatly be appreciated.
| 
| Adonis



More information about the Python-list mailing list