Diz
Overdosing on placebos
You might not remember this, but I was epic fail at the Java Script styleswitcher, and now I'm working on a PHP one.
I followed the guide on this page.
Is there something missing?
In case that isn't enough, here's my code:
^In the file called styleswitcher.php
^On each page
^What I used to put a link to each style
Through all of this, I just get a default black and white layout, no styles at all.
I followed the guide on this page.
Is there something missing?
In case that isn't enough, here's my code:
PHP:
<?php
$style['1'] = 'stylesheet.css';
$style['2'] = 'stylesheet2.css';
$style['3'] = 'stylesheet3.css';
$style['4'] = 'stylesheet4.css';
$no = intval($_REQUEST['style']);
if($style[$no]){
$expiration = 60 * 60 * 24 * 365 * 100 + time();
setcookie('style', $no, $expiration);
$http = parse_url($_SERVER['HTTP_REFERER']);
$gotourl = "ditto.ifastnet.com/home.php" . $http['path'];
header("Location: $gotourl");
}else {
print "Invalid style! Please don't try to hack DD";
}
?>
PHP:
<?php
if(isset($_COOKIE['style'])){
$no = intval($_COOKIE['style']);
$style['1'] = 'stylesheet.css';
$style['2'] = 'stylesheet2.css';
$style['3'] = 'stylesheet3.css';
$style['4'] = 'stylesheet4.css';
print "<link rel='stylesheet' href='" . $style[$no] . "' />";
}
else {
print "<link rel='stylesheet' href='DEFAULT.css' />";
}
?>
PHP:
<a href="http://ditto.ifastnet.com/styleswitcher.php?style=1">Normal Ditto Style</a>
<a href="http://ditto.ifastnet.com/styleswitcher.php?style=2">Shiny Ditto Style</a>
<a href="http://ditto.ifastnet.com/styleswitcher.php?style=3">Spring Style</a>
<a href="http://ditto.ifastnet.com/styleswitcher.php?style=4">Electric Style</a>
Through all of this, I just get a default black and white layout, no styles at all.