Jump to content

php skinning problems


kylee

Recommended Posts

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

 

 

Link to comment
Share on other sites

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),'/');

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

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.