Jump to content
xisto Community
Sign in to follow this  
Leah

Help Skinning My Site with php

Recommended Posts

here my site, Crystal Illusion each link is suppost to take you to a different layout... but it takes you too the same on AND then pictures and style sheet don't turn up- HELP

heres the cookie check code

<?$total_skins = 3;$default_skin = 1;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),'/','.crystal-illusion.myvnc.com');$skin=$newskin;$headervar = "$newskin/header";$footervar = "$newskin/footer";$extension = ".php";?>

heres the index, very messy
<script language="JavaScript" type="text/JavaScript"><!--function MM_swapImgRestore() { //v3.0  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;}function MM_preloadImages() { //v3.0  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}}function MM_findObj(n, d) { //v4.01  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);  if(!x && d.getElementById) x=d.getElementById(n); return x;}function MM_swapImage() { //v3.0  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}}//--></script><style type="text/css"><!--.style1 {	font-family: Verdana, Arial, Helvetica, sans-serif;	font-style: italic;	font-size: 12px;}{a:active {  	color: #D59DB6; font-weight: bold; text-transform: uppercase; letter-spacing: 0px; text-decoration: none; cursor:crosshair;}a:link {  	color: #D59DB6; font-weight: bold; text-transform: uppercase; letter-spacing: 0px; text-decoration: none; cursor: crosshair;}a:visited {  	color: #D59DB6; font-weight: bold; text-transform: uppercase; letter-spacing: 0px; text-decoration: none; cursor: crosshair;}a:hover {  	color: #CE749A;text-decoration: none; text-transform: uppercase; font-weight: bold; cursor:crosshair;letter-spacing: 0px;}}--></style><body onLoad="MM_preloadImages('images/choose.jpg')"><p> </p><p> </p><p> </p><p> </p><p align="center"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image1','','images/choose.jpg',1)"><img src="images/choose%201.jpg" name="Image1" width="500" height="200" border="0"></a></p><p align="center"> </p><p align="center"><span class="style1">Card Captors </span></p><blockquote>  <blockquote>    <blockquote>      <blockquote>        <p align="center">	<a href="skins/index2.php?newskin=2"><img src="Skins/2/skurka%20layout.jpg" width="100" height="100" border="2"></a></p>        <p align="center"><span class="style1"> Daria </span></p>        <p align="center">  <a href="skins/index2.php?newskin=1"><img src="Skins/1/layout%20daria.jpg" width="100" height="100" border="2"></a> </p>        <p align="center"><span class="style1">Leah </span></p>        <p align="center"><a href="skins/index2.php?newskin=3"><img src="Skins/3/images/layout.jpg" width="100" height="100" border="2"></a></p>        <blockquote>          <p align="right">S<strong>k</strong>I<strong>n</strong> I<strong>t </strong></p>          <p align="right"> </p>          <p align="right"> </p>          <p><strong><a href="links.htm">Links?</a></strong></p>        </blockquote>        <p align="left" class="style1"> </p>      </blockquote>    </blockquote>  </blockquote></blockquote>

and heres the body page thing

<? include("C:\phpdev\www\Skins\cookiecheck.php");?> <? include($headervar.$extension); ?> La la la! Bla Bla bla!<? include($footervar.$extension); ?>

BTW I'm hosting this webiste myself off my own surver, if u need to see anyother code just ask... and THANKS!!!

Share this post


Link to post
Share on other sites

well 4 things that i see wrong with it.

1: site is down at the moment so i can't really tell.

2- i don't see the php tag needed to run the scripts that you have.

3: you need to save your file as php as well in order to run the script.

4: external your css scripts use this code


<link REL="stylesheet" TYPE="text/css" href="style5.css">

and then open up notepad and put all this coding in it.

<!--.style1 {font-family: Verdana, Arial, Helvetica, sans-serif;font-style: italic;font-size: 12px;}{a:active {  color: #D59DB6; font-weight: bold; text-transform: uppercase; letter-spacing: 0px; text-decoration: none; cursor:crosshair;}a:link {  color: #D59DB6; font-weight: bold; text-transform: uppercase; letter-spacing: 0px; text-decoration: none; cursor: crosshair;}a:visited {  color: #D59DB6; font-weight: bold; text-transform: uppercase; letter-spacing: 0px; text-decoration: none; cursor: crosshair;}a:hover {  color: #CE749A;text-decoration: none; text-transform: uppercase; font-weight: bold; cursor:crosshair;letter-spacing: 0px;}}-->

and then save it as stylesheet.css and then load it up to your site that will clean up some of the coding on your page.

try out those suggestions and see if that helps you out.

Share this post


Link to post
Share on other sites

thanks it still doesn't work, i did some recoding and this is what my site looks like now

cookie check

<?$total_skins = 3;$default_skin = 1;$skin = $default_skin;if (isset($_COOKIE['skin']))   $skin = (int) $_COOKIE['skin'];if (isset($_GET['newskin']))  $skin = (int) $_GET['newskin'];if (($skin<1) or ($skin>$total_skins)) $skin = $default_skin;setcookie('skin',$skin,time()+(86400*365),'/');setcookie('skin',$skin,time()+(86400*365),'/','.crystal-illusion.myvnc.com');$headervar = "/".$skin."/header";$footervar = "/".$skin."/footer";$extension = ".php";?>


Index

<script language="JavaScript" type="text/JavaScript"><!--function MM_swapImgRestore() { //v3.0  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;}function MM_preloadImages() { //v3.0  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}}function MM_findObj(n, d) { //v4.01  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);  if(!x && d.getElementById) x=d.getElementById(n); return x;}function MM_swapImage() { //v3.0  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}}//--></script><style type="text/css"><!--.style1 {font-weight: bold}--></style><body onLoad="MM_preloadImages('images/choose.jpg')">        <p align="center"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Destiny','','images/choose.jpg',1)"><img src="images/choose%201.jpg" name="Destiny" width="500" height="200" border="0"></a>	</p>        <p align="center"> </p>        <p align="center">Card Captors</p>        <p align="center"><a href="http://crystal-illusion.myvnc.com/index2.php?newskin=2"><img src="Skins/2/skurka%20layout.jpg" width="100" height="100" border="2"></a></p>        <p align="center"><span class="style1"> Daria </span></p>        <p align="center">  <a href="http://crystal-illusion.myvnc.com/index2.php?newskin=1"><img src="Skins/1/layout%20daria.jpg" width="100" height="100" border="2"></a> </p>        <p align="center"><span class="style1">Leah </span></p>        <p align="center"><a href="http://crystal-illusion.myvnc.com/index2.php?newskin=3"><img src="Skins/3/images/layout.jpg" width="100" height="100" border="2"></a></p>        <p align="right"> S<strong>ki<em>n i</em>t^ </strong></p>        <p align="left"> </p>        <p align="left"> </p>        <p align="left"><a href="links.htm">Links?</a></p>

index 2

<? include("Skins\cookiecheck.php");?> <? include($headervar.$extension); ?> La la la! Bla Bla bla!<? include($footervar.$extension); ?> 

and also this is what it says when I click on a skin-it link

Warning: Failed opening '/1/header.php' for inclusion (include_path='') in c:\phpdev\www\index2.php on line 3La la la! Bla Bla bla! Warning: Failed opening '/1/footer.php' for inclusion (include_path='') in c:\phpdev\www\index2.php on line 7


THANKS

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.