Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Python CGI not working in Firefox but does in IE

Reply
Thread Tools

Python CGI not working in Firefox but does in IE

 
 
Harlin Seritt
Guest
Posts: n/a
 
      02-22-2006
I have this Python CGI script running:

Code:
print 'Content-type: text/plain\n'

location = 'http://server1.com'

page = '''
<html>
<head>
<meta http-equiv="Refresh" content="0; URL='''+location+'''">
</head>
<body></body>
</html>'''

print page
It works fine and redirects perfectly when using Internet Explorer but
only shows this in a Firefox window:

[OUTPUT]
<html>
<head>
<meta http-equiv="Refresh" content="0; URL=http://server1.com">
</head>
</html>
[/OUTPUT]

Is there anything I can do to fix this?

Also, is there a redirect command somewhere within Python CGI that can
get this done instead as I would actually prefer to have the CGI code
execute this rather than depend on the HTML to do it.

Thanks,

Harlin Seritt

 
Reply With Quote
 
 
 
 
Richard Brodie
Guest
Posts: n/a
 
      02-22-2006

"Harlin Seritt" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...

> [CODE]
> print 'Content-type: text/plain\n'


That's your problem. You've said text/plain when you meant text/html.



 
Reply With Quote
 
 
 
 
Iain King
Guest
Posts: n/a
 
      02-22-2006

Harlin Seritt wrote:
> I have this Python CGI script running:
>
>
Code:
> print 'Content-type: text/plain\n'
>
> location = 'http://server1.com'
>
> page = '''
> <html>
> <head>
> <meta http-equiv="Refresh" content="0; URL='''+location+'''">
> </head>
> <body></body>
> </html>'''
>
> print page
>
>
> It works fine and redirects perfectly when using Internet Explorer but
> only shows this in a Firefox window:
>
> [OUTPUT]
> <html>
> <head>
> <meta http-equiv="Refresh" content="0; URL=http://server1.com">
> </head>
> </html>
> [/OUTPUT]
>
> Is there anything I can do to fix this?
>
> Also, is there a redirect command somewhere within Python CGI that can
> get this done instead as I would actually prefer to have the CGI code
> execute this rather than depend on the HTML to do it.
>
> Thanks,
>
> Harlin Seritt


this snippet works (from code I wrote to implement a shoutbox):

print '''<html>
<head>
<meta http-equiv="refresh" content="0;URL='''+HOME+'''" />
</head>
<body>
<p>Please wait...</p>
</body>
</html>'''

I assume your version doesn't work because of the uppercase 'R'.

Iain

 
Reply With Quote
 
Harlin Seritt
Guest
Posts: n/a
 
      02-22-2006
Ack... I'm an idiot... Thanks Richard -- You're the Man!

 
Reply With Quote
 
Iain King
Guest
Posts: n/a
 
      02-22-2006

Iain King wrote:
> Harlin Seritt wrote:
> > I have this Python CGI script running:
> >
> >
Code:
> > print 'Content-type: text/plain\n'
> >
> > location = 'http://server1.com'
> >
> > page = '''
> > <html>
> > <head>
> > <meta http-equiv="Refresh" content="0; URL='''+location+'''">
> > </head>
> > <body></body>
> > </html>'''
> >
> > print page
> >
> >
> > It works fine and redirects perfectly when using Internet Explorer but
> > only shows this in a Firefox window:
> >
> > [OUTPUT]
> > <html>
> > <head>
> > <meta http-equiv="Refresh" content="0; URL=http://server1.com">
> > </head>
> > </html>
> > [/OUTPUT]
> >
> > Is there anything I can do to fix this?
> >
> > Also, is there a redirect command somewhere within Python CGI that can
> > get this done instead as I would actually prefer to have the CGI code
> > execute this rather than depend on the HTML to do it.
> >
> > Thanks,
> >
> > Harlin Seritt

>
> this snippet works (from code I wrote to implement a shoutbox):
>
> print '''<html>
> <head>
> <meta http-equiv="refresh" content="0;URL='''+HOME+'''" />
> </head>
> <body>
> <p>Please wait...</p>
> </body>
> </html>'''
>
> I assume your version doesn't work because of the uppercase 'R'.
>
> Iain


There's a well known phrase about the word 'assume'...

Iain

 
Reply With Quote
 
Kent Johnson
Guest
Posts: n/a
 
      02-22-2006
Harlin Seritt wrote:
> Also, is there a redirect command somewhere within Python CGI that can
> get this done instead as I would actually prefer to have the CGI code
> execute this rather than depend on the HTML to do it.


http://groups.google.com/group/comp....929fab0d414b2c
shows how do do a redirect with HTTP headers.

Kent
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Something works in Python but not in cgi. atalucas@gmail.com Python 1 10-14-2011 01:37 PM
Div with zindex=100 working fine under Firefox but not IE winstontuck@gmail.com HTML 0 08-15-2006 03:30 PM
cgi script runs under Opera, but not firefox nephish@xit.net Python 9 06-11-2005 10:47 PM
python IIS cgi working but loading extremely slow smartin Python 0 01-27-2005 02:37 PM
Python Program runs but itself but does not run under IDLE Ollie Python 0 10-02-2003 04:05 PM



Advertisments