Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Firefox broswer staring Perl CGI

Reply
Thread Tools

Firefox broswer staring Perl CGI

 
 
Jerry Preston
Guest
Posts: n/a
 
      11-08-2004
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


 
Reply With Quote
 
 
 
 
Tad McClellan
Guest
Posts: n/a
 
      11-08-2004
Jerry Preston <g-> 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
 
Reply With Quote
 
 
 
 
John Bokma
Guest
Posts: n/a
 
      11-08-2004
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
 
Reply With Quote
 
Chris Cole
Guest
Posts: n/a
 
      11-08-2004
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.
 
Reply With Quote
 
A. Sinan Unur
Guest
Posts: n/a
 
      11-08-2004
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
 
Reply With Quote
 
Stuart Moore
Guest
Posts: n/a
 
      11-08-2004
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)
 
Reply With Quote
 
John Bokma
Guest
Posts: n/a
 
      11-09-2004
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

 
Reply With Quote
 
John Bokma
Guest
Posts: n/a
 
      11-09-2004
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

 
Reply With Quote
 
Vetle Roeim
Guest
Posts: n/a
 
      11-10-2004
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.
 
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
Have I been staring at the screen too long? Iain Barnett Ruby 10 08-18-2010 09:50 AM
Firefox vs. Opera: Wierd broswer re-direct voice_of_reason@australia.edu HTML 0 12-16-2007 03:58 AM
Staring a Fresh with no XP backup disk... adam-white@hotmail.co.uk Computer Support 9 08-01-2007 06:18 AM
what's wrong calling a Perl/CGI script in Perl/CGI script under Tomcat server? kath Perl Misc 4 04-09-2007 09:21 PM
Loading page and staring half way down Kerrin Javascript 4 09-30-2004 12:40 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57