RE: python cgi script not understood as html
Your python script is not getting executed. I guess there is something wrong with the server configuration. #-Original Message- #From: Philippe C. Martin [mailto:[EMAIL PROTECTED] #Sent: Tuesday, October 25, 2005 1:27 AM #To: python-list@python.org #Subject: python cgi script not understood as html # #Hi, # #The following code outputs the actual HTML text to the browser, not the #interpreted text. # #Any idea ? # #Regards, # #Philippe #import cgi #import logging #import auth #this is the one you must implement (or use SCF ;-) # #html_ok = #Content-Type: text/html\n #!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN #http://www.w3.org/TR/html4/loose.dtd;\n #html\n #head\n # titleAccess Granted/title\n # meta name=GENERATOR content=Quanta Plus\n # meta http-equiv=Content-Type content=text/html; charset=koi8-r\n #/head\n #body\n #H1Access Granted/H1\n #HR\n #H4Welcome %s /H4\n #HR\n #/body\n #/html\n # # #html_nok = #Content-Type: text/html\n\n #!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN #http://www.w3.org/TR/html4/loose.dtd; #html # #head # titleAccess Granted/title # meta name=GENERATOR content=Quanta Plus # meta http-equiv=Content-Type content=text/html; charset=koi8-r #/head #body #H1Access Denied/H1 #HR # # #/body #/html # ## DISPLAY ACCESS DENIED PAGE #def Failure(): #print html_nok # ##DISPLAY ACCESS GRANTED PAGE #def Success(p_data): #print html_ok % (p_data) This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. -- http://mail.python.org/mailman/listinfo/python-list
Re: python cgi script not understood as html
the title should say python cgi script html output not understood as html Philippe C. Martin wrote: Hi, The following code outputs the actual HTML text to the browser, not the interpreted text. Any idea ? Regards, Philippe import cgi import logging import auth #this is the one you must implement (or use SCF ;-) html_ok = Content-Type: text/html\n !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd;\n html\n head\n titleAccess Granted/title\n meta name=GENERATOR content=Quanta Plus\n meta http-equiv=Content-Type content=text/html; charset=koi8-r\n /head\n body\n H1Access Granted/H1\n HR\n H4Welcome %s /H4\n HR\n /body\n /html\n html_nok = Content-Type: text/html\n\n !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; html head titleAccess Granted/title meta name=GENERATOR content=Quanta Plus meta http-equiv=Content-Type content=text/html; charset=koi8-r /head body H1Access Denied/H1 HR /body /html # DISPLAY ACCESS DENIED PAGE def Failure(): print html_nok #DISPLAY ACCESS GRANTED PAGE def Success(p_data): print html_ok % (p_data) -- http://mail.python.org/mailman/listinfo/python-list
Re: python cgi script not understood as html
Philippe C. Martin wrote: Hi, The following code outputs the actual HTML text to the browser, not the interpreted text. Any idea ? html_ok = Content-Type: text/html\n html ... Avoid the starting newline (before content-type). Add at least TWO newlines after content-type. Or use a package to handle the HTTP stuff for you. -- http://mail.python.org/mailman/listinfo/python-list
Re: python cgi script not understood as html
Philippe C. Martin wrote: The following code outputs the actual HTML text to the browser, not the interpreted text. html_ok = Content-Type: text/html\n !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd;\n HTTP header lines must end with \r\n, not just with \n. Not sure this is the solution to your specific problem though... -Peter -- http://mail.python.org/mailman/listinfo/python-list
Re: python cgi script not understood as html
Many thanks !! Regards, Philippe Mitja Trampus wrote: Philippe C. Martin wrote: Hi, The following code outputs the actual HTML text to the browser, not the interpreted text. Any idea ? html_ok = Content-Type: text/html\n html ... Avoid the starting newline (before content-type). Add at least TWO newlines after content-type. Or use a package to handle the HTTP stuff for you. -- http://mail.python.org/mailman/listinfo/python-list
Re: python cgi script not understood as html
It is, thanks. Philippe Peter Hansen wrote: Philippe C. Martin wrote: The following code outputs the actual HTML text to the browser, not the interpreted text. html_ok = Content-Type: text/html\n !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd;\n HTTP header lines must end with \r\n, not just with \n. Not sure this is the solution to your specific problem though... -Peter -- http://mail.python.org/mailman/listinfo/python-list