Re: Why are my style sheets all listed on one line?
| From: | Chris W | Date: | Fri, 30 Jan 2004 15:03:01 +0000 |
| Subject: | Re: Why are my style sheets all listed on one line? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-176345@lists.php.net to get a copy of this message | ||
Freedomware wrote:
I'm still fairly new to PHP, so there may be a simple fix for my relatively trivial complaint. I'm using an included page as a head section. It works fine, except that when preview a page and view the source, all the style sheets are displayed on one looooong line, like this:It sounds like you have figured out the problem, however I thought I would share another method that I like to use in similar situations. <?php $todayDate = date("m-d-Y"); print<<<END <title>Freedomware > $myname </title> <meta name="description" content=" $myname versus Microsoft" /> <meta name="keywords" content=" $myname versus Microsoft" /> <meta name="mssmarttagspreventparsing" content="true" /> <meta http-equiv="content-Type" content="text/html; charset=iso-8859-1" /> <meta name="author" content="David Blomstrom" /> <script src=" $periods js/swapclass.js" type="text/javascript"></script> <script language="JavaScript" src=" $periods js/sort.js"></script> <script language="JavaScript" src=" $periods js/ss.js"></script> <script language="JavaScript" type="text/JavaScript"> END; ?> there is one pit fall on this method that I run into sometimes. If your code is indented like it should be that moves the "END;" away from the beginning of the line and it won't work. So this wouldn't work, while(for a while){ if(this){
do stuff;
print<<<END
bunch of stuff here
END;
do more stuff;
}
end of while
}
The "END;" must be the first text on the line, so it has to be like this,
while(for a while){
if(this){
do stuff;
print<<<END
bunch of stuff here
END;
do more stuff;} end of while } Chris W