Firefox broswer staring Perl CGI

Discussion in 'Perl Misc' started by Jerry Preston, Nov 8, 2004.

  1. I just checked out some of my Perl CGI scripts that work fine using IE and
    Netscape and I find that Firefox is lost or I am. I start my scripts with
    the following:

    print $query->header();
    print $query->start_html( -title => "$main_title By Jerry Preston",
    );
    print $query->startform( -name => 'update_form',
    -method => 'POST',
    );

    When I do a view page source the following starts the code:

    <?xml version="1.0" encoding="iso-8859-1"?>
    <!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

    What am I missing?

    Thanks,

    Jerry
     
    Jerry Preston, Nov 8, 2004
    #1
    1. Advertising

  2. Jerry Preston <> wrote:

    > I just checked out some of my Perl CGI scripts that work fine using IE and
    > Netscape and I find that Firefox is lost or I am.



    > When I do a view page source the following starts the code:
    >
    ><?xml version="1.0" encoding="iso-8859-1"?>
    ><!DOCTYPE html
    > PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    >
    > What am I missing?



    You are missing a question.

    Is there something wrong?

    Did you want to ask a question about that wrong something?

    What did you expect to happen? What is happening instead?


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
     
    Tad McClellan, Nov 8, 2004
    #2
    1. Advertising

  3. Jerry Preston

    John Bokma Guest

    Jerry Preston wrote:

    > I just checked out some of my Perl CGI scripts that work fine using IE
    > and Netscape and I find that Firefox is lost or I am. I start my
    > scripts with the following:
    >
    > print $query->header();


    ^^^^ defaults to XHTML

    > <?xml version="1.0" encoding="iso-8859-1"?>
    > <!DOCTYPE html
    > PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

    ^^^^^

    > What am I missing?


    -no_xhtml
    By default, CGI.pm versions 2.69 and higher emit XHTML
    (http://www.w3.org/TR/xhtml1/). The -no_xhtml pragma disables this
    feature.

    Hence:

    use CGI qw/:standard -no_xhtml/;

    or use

    my $cgi = new CGI;
    print $cgi->header( 'text/html' );

    I recommend calling the thingy $cgi instead of $query, printing html to
    a query sounds odd to me.


    --
    John MexIT: http://johnbokma.com/mexit/
    personal page: http://johnbokma.com/
    Experienced programmer available: http://castleamber.com/
    Happy Customers: http://castleamber.com/testimonials.html
     
    John Bokma, Nov 8, 2004
    #3
  4. Jerry Preston

    Chris Cole Guest

    On Mon, 08 Nov 2004 06:55:04 +0000, John Bokma wrote:

    > Jerry Preston wrote:
    >
    >> I just checked out some of my Perl CGI scripts that work fine using IE
    >> and Netscape and I find that Firefox is lost or I am. I start my
    >> scripts with the following:
    >>
    >> print $query->header();

    >
    > ^^^^ defaults to XHTML
    >
    >> <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html
    >> PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

    > ^^^^^


    So what? XHTML is a perfectly valid way of creating web pages (CGI or
    otherwise). I have no problems with firefox displaying perl CGI using the
    default XHTML output.

    >> What am I missing?

    >
    > -no_xhtml
    > By default, CGI.pm versions 2.69 and higher emit XHTML
    > (http://www.w3.org/TR/xhtml1/). The -no_xhtml pragma disables this
    > feature.
    >
    > Hence:
    >
    > use CGI qw/:standard -no_xhtml/;
    >
    > or use
    >
    > my $cgi = new CGI;
    > print $cgi->header( 'text/html' );


    Neither of these are necessary... The problem is due to something else.

    To the OT. You're far too vague in your message. Please repost with any
    errors dsiplayed in FF and a complete example of code that shows your
    problem so that we can test it also.

    > I recommend calling the thingy $cgi instead of $query, printing html to
    > a query sounds odd to me.


    It may sound odd to you, but makes sense to me. CGI is often a DB
    front-end so a cgi query *to the db* is perfectly reasonable in this case.

    Chris.
     
    Chris Cole, Nov 8, 2004
    #4
  5. John Bokma <> wrote in
    news:Xns959B95662B83castleamber@130.133.1.4:

    > Jerry Preston wrote:
    >
    >> I just checked out some of my Perl CGI scripts that work fine using IE
    >> and Netscape and I find that Firefox is lost or I am. I start my
    >> scripts with the following:
    >>
    >> print $query->header();

    ....
    >
    > my $cgi = new CGI;
    > print $cgi->header( 'text/html' );
    >
    > I recommend calling the thingy $cgi instead of $query, printing html to
    > a query sounds odd to me.


    But you are not printing to a query, you are printing to STDOUT :)

    Sinan
     
    A. Sinan Unur, Nov 8, 2004
    #5
  6. Jerry Preston

    Stuart Moore Guest

    Jerry Preston wrote:

    > I just checked out some of my Perl CGI scripts that work fine using IE and
    > Netscape and I find that Firefox is lost or I am. I start my scripts with
    > the following:
    >
    > print $query->header();
    > print $query->start_html( -title => "$main_title By Jerry Preston",
    > );
    > print $query->startform( -name => 'update_form',
    > -method => 'POST',
    > );
    >
    > When I do a view page source the following starts the code:
    >
    > <?xml version="1.0" encoding="iso-8859-1"?>
    > <!DOCTYPE html
    > PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    >
    > What am I missing?


    Are you able to put a sample CGI script up somewhere so we can look at
    the html it's creating? Do the smallest script that shows the behaviour
    (i.e. first look at print header(), start_html(), "Foo", end_html(); and
    then if that works keep adding other bits in)
     
    Stuart Moore, Nov 8, 2004
    #6
  7. Jerry Preston

    John Bokma Guest

    A. Sinan Unur wrote:

    > John Bokma <> wrote in


    >> my $cgi = new CGI;
    >> print $cgi->header( 'text/html' );
    >>
    >> I recommend calling the thingy $cgi instead of $query, printing html to
    >> a query sounds odd to me.

    >
    > But you are not printing to a query, you are printing to STDOUT :)


    LOL. I ment: calling the header method of a query sounds stupid to me.

    --
    John Small Perl scripts: http://johnbokma.com/perl/
    Perl programmer available: http://castleamber.com/
    Happy Customers: http://castleamber.com/testimonials.html
     
    John Bokma, Nov 9, 2004
    #7
  8. Jerry Preston

    John Bokma Guest

    Chris Cole wrote:

    > On Mon, 08 Nov 2004 06:55:04 +0000, John Bokma wrote:


    [ CGI.pm uses XHTML as default ]

    > So what? XHTML is a perfectly valid way of creating web pages (CGI or
    > otherwise). I have no problems with firefox displaying perl CGI using
    > the default XHTML output.


    XHTML is a joke. Also, quite some hosting providers don't send the right
    headers, and hence can confuse browsers.

    If you don't need XHTML (you don't) or don't understand it, don't use
    it.

    >> my $cgi = new CGI;
    >> print $cgi->header( 'text/html' );

    >
    > Neither of these are necessary... The problem is due to something
    > else.


    Probably not sending out correct headers to Firefox gets confused. XHTML
    is black magic, don't use it, your site can do without it perfectly.

    >> I recommend calling the thingy $cgi instead of $query, printing html
    >> to a query sounds odd to me.

    >
    > It may sound odd to you, but makes sense to me. CGI is often a DB
    > front-end so a cgi query *to the db* is perfectly reasonable in this
    > case.


    Ah, yeah, and how does for example the header method relate to a query?
    To me, $cgi makes it clear what I am doing, it's CGI.

    CGI.pm is IMNSHO too much in one module anyway.

    --
    John Small Perl scripts: http://johnbokma.com/perl/
    Perl programmer available: http://castleamber.com/
    Happy Customers: http://castleamber.com/testimonials.html
     
    John Bokma, Nov 9, 2004
    #8
  9. Jerry Preston

    Vetle Roeim Guest

    On 9 Nov 2004 18:44:18 GMT, John Bokma <> wrote:

    > Chris Cole wrote:
    >
    >> On Mon, 08 Nov 2004 06:55:04 +0000, John Bokma wrote:

    >
    > [ CGI.pm uses XHTML as default ]
    >
    >> So what? XHTML is a perfectly valid way of creating web pages (CGI or
    >> otherwise). I have no problems with firefox displaying perl CGI using
    >> the default XHTML output.

    >
    > XHTML is a joke.


    I've never heard this statement before, and I'm somewhat intrigued. This
    is a little OT for this group, but could you explain it, or do you have
    any pointers to where I can read a critique of XHTML?


    [...]
    --
    It's not a bug, it's the future.
     
    Vetle Roeim, Nov 10, 2004
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike John
    Replies:
    0
    Views:
    616
    Mike John
    Jul 6, 2003
  2. =?Utf-8?B?ZGF2aWQ=?=
    Replies:
    1
    Views:
    497
    Bruce Barker
    Jan 28, 2006
  3. Replies:
    0
    Views:
    367
  4. Iain Barnett
    Replies:
    10
    Views:
    231
    Brian Candler
    Aug 18, 2010
  5. Kerrin
    Replies:
    4
    Views:
    495
    Kerrin
    Sep 30, 2004
Loading...

Share This Page