Jump to content

There must be a way!


DeathStar

Recommended Posts

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?

Link to comment
Share on other sites

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 :D

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.