I've been looking at caching my files since my host has told me the scripts i'm using take up to much RAM
I've followed the below tutorial
http://www.theukwebdesigncompany.com/articles/php-caching.php
Which i can get working, but my website has different skins for different people. They choose which one they want to use. Obviously when i cache the page it only cahces one skin, no matter what one the user is using.
In all of my pages i have the following include ibn the head section
<?php include('css/css.php'); ?>
and in the css.php file
<?php
$layout = "SELECT layout FROM user_settings WHERE user_id = '".clean($_COOKIE['mttcg']['i'])."' LIMIT 1";
$lresult = mysql_query($layout) or die(sql_error($layout));
if(mysql_num_rows($lresult)) {
while($lrow = mysql_fetch_array($lresult)) {
if($lrow['layout'] == 12) {
print '<link href="/css/layout12.css" rel="stylesheet" type="text/css" />';
} elseif($lrow['layout'] == 13) {
print '<link href="/css/layout13.css" rel="stylesheet" type="text/css" />';
}
}
} else {
print '<link href="/css/layout13.css" rel="stylesheet" type="text/css" />';
}
?>
<!-- This is for use within Dreamweaver and should be commented out when used live
<link href="/css/layout13.css" rel="stylesheet" type="text/css" /> -->
How would i go about getting it working with the correct layout for the correct user?