Firefox broswer staring Perl CGI

J

Jerry Preston

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
 
T

Tad McClellan

Jerry Preston said:
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?
 
J

John Bokma

Jerry said:
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.
 
C

Chris Cole

^^^^ defaults to XHTML

^^^^^

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.
-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.
 
A

A. Sinan Unur

....

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
 
S

Stuart Moore

Jerry said:
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)
 
J

John Bokma

A. Sinan Unur said:
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.
 
J

John Bokma

[ 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.
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.
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.
 
V

Vetle Roeim

[ 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?


[...]
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Login page perl/CGI 2
problem with charset 2
cryptic error in cgi script 2
Once again: CGI help 3
cgi question 3
cgi and escapeHTML but not ampersand 5
Login page perl/CGI 1
speeding up cgi perl 11

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top