• Welcome to The Cave of Dragonflies forums, where the smallest bugs live alongside the strongest dragons.

    Guests are not able to post messages or even read certain areas of the forums. Now, that's boring, don't you think? Registration, on the other hand, is simple, completely free of charge, and does not require you to give out any personal information at all. As soon as you register, you can take part in some of the happy fun things at the forums such as posting messages, voting in polls, sending private messages to people and being told that this is where we drink tea and eat cod.

    Of course I'm not forcing you to do anything if you don't want to, but seriously, what have you got to lose? Five seconds of your life?

Another Styleswitcher fail

Each page:
PHP:
<?php
    $style[1] = 'http://ditto.ifastnet.com/stylesheet.css';
    $style[2] = 'http://ditto.ifastnet.com/stylesheet2.css';
    $style[3] = 'http://ditto.ifastnet.com/stylesheet3.css';
    $style[4] = 'http://ditto.ifastnet.com/stylesheet4.css';
if(!isset($_COOKIE['style']))
{
     $no = 1;
}  

else
{
    $no = $_COOKIE['style'];
}
?>

Links are fine.

styleswitcher.php:
PHP:
<?php

$style[1] = 'http://ditto.ifastnet.com/stylesheet.css';
$style[2] = 'http://ditto.ifastnet.com/stylesheet2.css';
$style[3] = 'http://ditto.ifastnet.com/stylesheet3.css';
$style[4] = 'http://ditto.ifastnet.com/stylesheet4.css';

$no = $_GET['style'];

if($style[$no]){
    $expiration = 60 * 60 * 24 * 365 * 100 + time();
    setcookie('style', $no, $expiration);
	
    header("Location: http://ditto.ifastnet.com/home.php");
}
elseif($no>count($style)){
    print "Invalid style! Please don't try to hack DD";
}
?>
 
Ok, I tried that, and, when I went to the about me page, where I put the stuff you told me. When I went there, the page was still plain black and white. When I clicked the link to change the style, it displayed the default style, but on my home page. I then clicked to change the style to something different, and it reloaded the same page with the same style.
 
Sorry, but double post so that people see this

Could it be that my styleswitcher isn't working because I don't have <style></style> tags around my php?
 
Oh, ok. Its good since I didn't do that.

Aww, heck with it. I'm going back to Javascript
 
Last edited:
Back
Top Bottom