brownleaf Posted September 28, 2008 Share Posted September 28, 2008 I have skinned my site. This is how the users pick the skins: <p> <a href="setskin.php?skin=1"><img src="01.gif" alt=" "/></a><br/> <a href="setskin.php?skin=2"><img src="02.gif" alt=" "/></a><br/> <a href="setskin.php?skin=3"><img src="03.gif" alt=" "/></a><br/> <a href="setskin.php?skin=4"><img src="04.gif" alt=" "/></a><br/> <a href="setskin.php?skin=5"><img src="05.gif" alt=" "/></a><br/> <a href="setskin.php?skin=6"><img src="06.gif" alt=" "/></a> </p> This is the setskin file it goes to: <?php if (isset($_GET['skin']) && is_numeric($_GET['skin']) && is_dir('/home/audyrjye/public_html/cisinteract.info/skins/' . $_GET['skin'])) { setcookie("myskin", $_GET['skin'], time()+(31*86400)); header("Location: /index.php"); } ?> This is a code.php file included in every page as part of this: <?php $pathtoskins = "/home/audyrjye/public_html/cisinteract.info/skins/"; $defaultskin = 1; if (isset($_COOKIE['myskin']) && file_exists($pathtoskins . $_COOKIE['myskin'] . '/stylesheet.css')) { $styles = "/skins/" . $_COOKIE['myskin'] . "/stylesheet.css"; } else { $styles = "/skins/" . $defaultskin . "/stylesheet.css"; } ?> My problem is that I have installed a premade question asking script within a folder called "ask". So, for some bizarre inexplicable reason, the images and files i'm linking to outside of the folder cannot be found unless I type out the whole URL, i.e. http://cisinteract.info/01.gif. HOWEVER, when I type out the whole URL for the setskin thing http://cisinteract.info/setskin?skin=5, it only changes the skins for all the other pages on the site (the ones that are not within the ask folder). So, I tried uploading all the skins files within the ask folder, however, it is not compatible with the rest of the site! With the skin on the rest of the site changes it does not change and when I change the skin for that page, the rest of the site does not change. I THINK that the problem here, is within the code.php file: if (isset($_COOKIE['myskin']) && file_exists($pathtoskins . $_COOKIE['myskin'] . '/stylesheet.css')) { $styles = "/skins/" . $_COOKIE['myskin'] . "/stylesheet.css"; } else { $styles = "/skins/" . $defaultskin . "/stylesheet.css"; } Even though above that the path to skins, the $style variable = skins, so it autmatically assumes that the skins folder is WITHIN the ask folder. I tried to change the skins folder to the path to skins adress and even just cisinteract.info/skins but then the skins don't even show up. I'm so confused and I don't know what to do. Please help me? Thank you so much Link to comment https://forums.phpfreaks.com/topic/126153-skinning-problem/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.