kylee Posted December 27, 2007 Share Posted December 27, 2007 im having a problem skinning my site. everything is fine EXCEPT this: i change my skin from my default & it changes fine but it wont stay with the new skin heres my cookiecheck.php <? $total_skins = 2; $default_skin = 2; if (isset($_REQUEST['newskin'])) { $newskin=(int)$_REQUEST['newskin']; if ( ($newskin<1) OR ($newskin>$total_skins) ) $newskin=$default_skin; } elseif (isset($_REQUEST['skin'])) { $newskin=(int)$skin; if ( ($skin<1) OR ($skin>$total_skins) ) $newskin=$default_skin; } else $newskin=$default_skin; $skin=$newskin; setcookie ('skin', "", time() - 3600); setcookie('skin',$newskin,time()+(86400*365),'/'); setcookie('skin',$newskin,time()+(86400*365),'/','.kylee.synthoxide.net'); $skin=$newskin; $headervar = "/home/kylee96/kylee.synthoxide.net/skins/$newskin/header"; $footervar = "/home/kylee96/kylee.synthoxide.net/skins/$newskin/footer"; $contentvar = "/home/kylee96/kylee.synthoxide.net/skins/$newskin/content"; $extension = ".php"; ?> & heres what im pasting into every content page <? include("/home/kylee96/kylee.synthoxide.net/cookiecheck.php");?> <? include($headervar.$extension); ?> <? include($contentvar.$extension); ?> content <? include($footervar.$extension);?> can anybody see if theres a mistake in my cookiecheck.php? thanks Quote Link to comment https://forums.phpfreaks.com/topic/83314-php-skinning-problems/ Share on other sites More sharing options...
kylee Posted December 27, 2007 Author Share Posted December 27, 2007 if you want an example of what i mean -- kylee.synthoxide.net/pages/graphics.php and then click on skin # 1 . or at least if you could suggest a really good tutorial or something on skinning.. Quote Link to comment https://forums.phpfreaks.com/topic/83314-php-skinning-problems/#findComment-424234 Share on other sites More sharing options...
kylee Posted December 27, 2007 Author Share Posted December 27, 2007 is there something wrong with my code? please let me know, otherwise if you think theres nothing wrong or you cant figure out a solution can you at least let meknow? Quote Link to comment https://forums.phpfreaks.com/topic/83314-php-skinning-problems/#findComment-424262 Share on other sites More sharing options...
revraz Posted December 27, 2007 Share Posted December 27, 2007 Where are you reading the cookie? Also, condense these three into just one, since you can't remove and reset on the same page anyways setcookie ('skin', "", time() - 3600); setcookie('skin',$newskin,time()+(86400*365),'/'); setcookie('skin',$newskin,time()+(86400*365),'/','.kylee.synthoxide.net'); to setcookie('skin',$newskin,time()+(86400*365),'/'); Quote Link to comment https://forums.phpfreaks.com/topic/83314-php-skinning-problems/#findComment-424267 Share on other sites More sharing options...
kylee Posted December 27, 2007 Author Share Posted December 27, 2007 i am reading the cookiecheck.php from all my content pages so like: <? include("/home/kylee96/kylee.synthoxide.net/skins/cookiecheck.php");?> <? include($headervar.$extension); ?> content goes here <? include($footervar.$extension); ?> i changed what you asked as well -- condensing Quote Link to comment https://forums.phpfreaks.com/topic/83314-php-skinning-problems/#findComment-424269 Share on other sites More sharing options...
revraz Posted December 27, 2007 Share Posted December 27, 2007 Post the code on where you actually check the cookie to see if it's set. Or are you trying to get it here elseif (isset($_REQUEST['skin'])) Quote Link to comment https://forums.phpfreaks.com/topic/83314-php-skinning-problems/#findComment-424272 Share on other sites More sharing options...
revraz Posted December 27, 2007 Share Posted December 27, 2007 . Quote Link to comment https://forums.phpfreaks.com/topic/83314-php-skinning-problems/#findComment-424273 Share on other sites More sharing options...
kylee Posted December 27, 2007 Author Share Posted December 27, 2007 in the tutorial that i followed there was no code to see where if it had set..? you simply copy & paste the cookiecheck.php upload it and then create your skins in a folder and then create a folder for skin1 and skin 2 which have header.php and footer.php there was no other page to see what youre asking Quote Link to comment https://forums.phpfreaks.com/topic/83314-php-skinning-problems/#findComment-424274 Share on other sites More sharing options...
revraz Posted December 27, 2007 Share Posted December 27, 2007 See if this helps http://www.phpfreaks.com/tutorials/120/1.php Quote Link to comment https://forums.phpfreaks.com/topic/83314-php-skinning-problems/#findComment-424276 Share on other sites More sharing options...
kylee Posted December 27, 2007 Author Share Posted December 27, 2007 i looked at the tutorial, however im not really sure what that has to do with skinning? if i were to use elseif (isset($_REQUEST['skin'])) where would i put it? Quote Link to comment https://forums.phpfreaks.com/topic/83314-php-skinning-problems/#findComment-424281 Share on other sites More sharing options...
revraz Posted December 27, 2007 Share Posted December 27, 2007 It has nothing to do with skinning and neither does this Topic really. Your post appears to be a question on Cookies since you stated it changes. It changes because the Cookie isn't set, therefore your script sets it back to Default. That's the way I read it at least, since you posted your Cookie code. Quote Link to comment https://forums.phpfreaks.com/topic/83314-php-skinning-problems/#findComment-424286 Share on other sites More sharing options...
kylee Posted December 27, 2007 Author Share Posted December 27, 2007 okay. so exactly how can i set the cookie? Quote Link to comment https://forums.phpfreaks.com/topic/83314-php-skinning-problems/#findComment-424288 Share on other sites More sharing options...
kylee Posted December 27, 2007 Author Share Posted December 27, 2007 or is there someone i can 'test' the cookiecheck.php? Quote Link to comment https://forums.phpfreaks.com/topic/83314-php-skinning-problems/#findComment-424293 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.