[Tutor] Redirect from a CGI script
Python
python at venix.com
Sat Jan 20 21:24:06 CET 2007
On Sat, 2007-01-20 at 10:13 -0800, Danny Yoo wrote:
>
> On Sat, 20 Jan 2007, Paulino wrote:
>
> > Still doesn't work.
>
> [some text cut]
>
> > I tryed all the sugestions from Andre with no succes.
> >
> > The cgi script as only these two lines:
> > 'print "Content-type: text/html\r\n"
> > 'print "Location: http://python.org/\r\n\r"
>
>
> Ok, good.
>
> The last line of the program looks suspicious. If it helps, let me
> rearrange the program that you've written to:
>
> ###############################################
> print "Content-type: text/html\r\n"
> print "Location: http://python.org/\r\n"
> print "\r"
> ###############################################
>
> The code is missing the critical '\n' that allows the web browser to
> recognize the header.
That gets supplied from the print - doesn't it?.
sys.stdout.write(...) would need the final \n and might actually be
clearer.
> _______________________________________________
> Tutor maillist - Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
--
Lloyd Kvam
Venix Corp
More information about the Tutor
mailing list