AllExperts > Perl & CGI 
Search      
Perl & CGI
Volunteer
Answers to thousands of questions
 Home · More Perl & CGI Questions · Answer Library  · Encyclopedia ·
More Perl & CGI Answers
Question Library

Ask a question about Perl & CGI
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Marty Landman
Expertise
Perl programming using CGI, databases, HTML templating, and website automation.

Experience
Web developer since 1998, owner of Face 2 Interface.

 
   

You are here:  Experts > Computing/Technology > Perl/PHP > Perl & CGI > cgi html problem

Perl & CGI - cgi html problem


Expert: Marty Landman - 7/10/2009

Question
#!C:activeperl/perl/bin/perl

print <<EndOfHTML;
content-type:text/html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

</head>
<body>
<h1> hello wor</h1>
</BODY>
</HTML>
EndOfHTML
 exit(0);

Answer
Try having 2 carriage returns after your first line ie.

content-type:text/html

<!DOCTYPE html PUBLIC "-//W3C//DT   etc..

instead of

content-type:text/html
<!DOCTYPE html PUBLIC "-//W3C//DT   etc..


--
Marty Landman, Face 2 Interface Inc.
Free Database Search App: http://face2interface.com/Products/FormATable.shtml


Add to this Answer   Ask a Question


 
User Agreement | Privacy Policy | Kids' Privacy Policy | Help
Copyright  © 2008 About, Inc. AllExperts, AllExperts.com, and About.com are registered trademarks of About, Inc. All rights reserved.