[CGI] Why is HTML not rendered?

Alexander Blinne news at blinne.net
Fri Aug 17 09:40:26 EDT 2012


On 17.08.2012 15:27, Gilles wrote:
> For some reason, this CGI script that I found on Google displays the
> contents of the variable but the HTML surrounding it is displayed
> as-is by the browser instead of being rendered:

> print "Content-Type: text/plain;charset=utf-8"

With this line you tell the browser to expect a simple plain text file
and no html. Change the line to

print "Content-Type: text/html;charset=utf-8"

and it should work.




More information about the Python-list mailing list