DeathStar Posted May 18, 2007 Share Posted May 18, 2007 Hi. I have a few pages with cookies. AS the no. 1 rules with cookies: No html can be put before a cookie. but here comes my problem. I include a script/style.css but how can i put it on the top so the whole document can get effected by the style? I cant put it underneath the cookies because the errors has classes thats in the stylesheet. Any Ideas? Quote Link to comment https://forums.phpfreaks.com/topic/52003-there-must-be-a-way/ Share on other sites More sharing options...
taith Posted May 18, 2007 Share Posted May 18, 2007 personally... i learned my programming so i template... i dealt with this all the time(and got fed up )... setcookie(); $head.=''; $body.='<span class="asdf">text</span>'; require_once('template.php'); then on your template page <?=$head?> <table> <tr> <td><?=$body?></td> </tr> </table> basically... your not outputing any data, until it hits the template page, where all your variables get output :-) you can do stuff in/out of order and nothing really cares(html/css wise)... lol... as long as your css is a varialbe being output, and your body uses them css, everythings happy Quote Link to comment https://forums.phpfreaks.com/topic/52003-there-must-be-a-way/#findComment-256287 Share on other sites More sharing options...
DeathStar Posted May 18, 2007 Author Share Posted May 18, 2007 Can you please explain in more detail? Quote Link to comment https://forums.phpfreaks.com/topic/52003-there-must-be-a-way/#findComment-256377 Share on other sites More sharing options...
taith Posted May 18, 2007 Share Posted May 18, 2007 index.php <? require_once('common.php'); $body.='<table>'; $body.=' <tr>'; $body.=' <td><span class=text>text</span></td>'; $css.='.text{ text-align:center; }'; $head.='<meta keywords="i like cheese">'; $body.=' </tr>'; #i can set cookies in here, sessions, whatever i need $body.='</table>'; require_once('template.php'); ?> template.php <head> <?=$head?> <style> <?=$css?> </style> </head> <table> <tr> <td><?=$body?></td> </tr> </table> i might also say... this saves ALOT of space on the server... as your using the same template page again and again and again... also is pretty fast! Quote Link to comment https://forums.phpfreaks.com/topic/52003-there-must-be-a-way/#findComment-256383 Share on other sites More sharing options...
DeathStar Posted May 18, 2007 Author Share Posted May 18, 2007 OK thank you very much. Will try. btw. Your signature: not if your using windows Quote Link to comment https://forums.phpfreaks.com/topic/52003-there-must-be-a-way/#findComment-256650 Share on other sites More sharing options...
per1os Posted May 18, 2007 Share Posted May 18, 2007 btw. Your signature: not if your using windows No, especially windows. The majority of people who use windows are users who know nothing about computers =) Linux = teh l33t f3w. Quote Link to comment https://forums.phpfreaks.com/topic/52003-there-must-be-a-way/#findComment-256666 Share on other sites More sharing options...
DeathStar Posted May 18, 2007 Author Share Posted May 18, 2007 yes, linux is the best. You can edit anyhting, about. But thats why windows is there, so that people can destroy it and blame microsoft Quote Link to comment https://forums.phpfreaks.com/topic/52003-there-must-be-a-way/#findComment-256710 Share on other sites More sharing options...
taith Posted May 19, 2007 Share Posted May 19, 2007 LOL! i work at a call center presently... 99% of our calls are windows, and my customers prove me right every call... you make a program stupid proof, the world makes a stupider person... Quote Link to comment https://forums.phpfreaks.com/topic/52003-there-must-be-a-way/#findComment-256886 Share on other sites More sharing options...
MadTechie Posted May 19, 2007 Share Posted May 19, 2007 The saying i use is kinda the same no matter how idiot proof you make your software someone will make a better idiot Quote Link to comment https://forums.phpfreaks.com/topic/52003-there-must-be-a-way/#findComment-256893 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.