I have a CGI script that I wrote in python to use as the home page of the website I am creating. Everything works properly except when you view the page instead of seeing the page that it outputs you see the source code of the page, why is this? I dont mean that it shows me the source code of the .py file, it shows me all the printed information as if I were looking at a .htm file in notepad.
Add a comment
|
2 Answers
The default Content Type is text, and if you forgot to send the appropriate header in your CGI file, you will end up with what you are seeing.
1 Comment
Wichid Nixin
I had this line
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> in the code that I thought took care of that but i guess not... I added print "Content-type: text/html" to the beginning of the script and it works now thanks!