• 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?

AobaruNet

That PHP switcher assumes that register_globals is on. Change $set in the switcher.php file to $_POST["set"] and you'll be fine.
 
switcher.php:
Code:
<?php
setcookie ('sitestyle', $_POST["set"], time()+31536000, »
	'/', 'http://www.aobarunet.vibrai.com', '0');
header("Location: $HTTP_REFERER");
?>

test.php:
Code:
<html>
<center>
<head>
<title>.:AobaruNet v5:.</title>

<link rel="stylesheet" type="text/css" 
	media="screen" title="User 
Defined Style" href="<?php echo 
(!$sitestyle)?'darkness':$sitestyle ?>.css" />

<link rel="alternate stylesheet" 
   type="text/css" media="screen" 
   title="Giggly Mew" href="gigglymew.css" />

</head>

~LEFT MENU CODE~

<td id="content" valign="top">

<a href="switcher.php?set=gigglymew">click here to change to GigglyMew!</a><br />
<a href="switcher.php?set=darkness">click here to change to Darkness!</a>
</td>

~RIGHT MENU CODE~
 
Remove the double arrow from your switcher.php, it's messing up the cookie function.

Code:
<?php
setcookie ('sitestyle', $_POST["set"], time()+31536000, '/', 'http://www.aobarunet.vibrai.com', '0');
header("Location: $HTTP_REFERER");
?>
 
Also, change both instances of $sitestyle in test.php to $_COOKIES["sitestyle"]. And since you're using links, and therefore GET and not POST, switcher.php should have $_GET["set"], not $_POST["set"].
 
When I had a php styleswitcher, I was told the http:// in the switcher code wasn't needed. But that may not affect it.
PHP:
<?php
setcookie ('sitestyle', $_POST["set"], time()+31536000, »
	'/', 'www.aobarunet.vibrai.com', '0');
header("Location: $HTTP_REFERER");
?>
 
Still not working.

switcher.php
Code:
<?php
setcookie ('sitestyle', $_GET["set"], time()+31536000,	'/', 

'www.aobarunet.vibrai.com/', '0');
header("Location: $HTTP_REFERER");
?>

test.php
Code:
<html>
<center>
<head>
<title>.:AobaruNet v5:.</title>

<link rel="stylesheet" type="text/css" 
	media="screen" title="User 
Defined Style" href="<?php echo 
(!$_COOKIES["sitestyle"])?'darkness':$_COOKIES["sitestyle"] ?>.css" />

<link rel="alternate stylesheet" 
   type="text/css" media="screen" 
   title="Giggly Mew" href="gigglymew.css" />
</head>

LMENU CODE~~~~

<td id="content" valign="top">

<a href="switcher.php?set=gigglymew">click here to change to GigglyMew!</a><br />
<a href="switcher.php?set=darkness">click here to change to Darkness!</a>
	</td>

RMENU CODE~~~~
 
Change
Code:
header("Location: $HTTP_REFERER");
to
Code:
header("Location: {$_SERVER['HTTP_REFERER']}");
Can't go wrong with superglobals

Oh, and $_COOKIES should be $_COOKIE (singular). Butterfree, seriously, I thought you were better than that :P
 
Still not working.

switcher.php
Code:
<?php
setcookie ('sitestyle', $_GET["set"], time()+31536000,	'/', 

'www.aobarunet.vibrai.com', '0');
header("Location: {$_SERVER['HTTP_REFERER']}");
?>

test.php
Code:
<html>
<center>
<head>
<title>.:AobaruNet v5:.</title>

<link rel="stylesheet" type="text/css" 
	media="screen" title="User 
Defined Style" href="<?php echo 
(!$_COOKIES["sitestyle"])?'darkness':$_COOKIE["sitestyle"] ?>.css" />

<link rel="alternate stylesheet" 
   type="text/css" media="screen" 
   title="Giggly Mew" href="gigglymew.css" />

</head>

RMENU~~~~~~

<td id="content" valign="top">

<a href="switcher.php?set=gigglymew">click here to change to GigglyMew!</a><br />
<a href="switcher.php?set=darkness">click here to change to Darkness!</a>
		</td>

LMENU~~~~
 
You still have one "$_COOKIES".

Code:
<link rel="stylesheet" type="text/css" 
	media="screen" title="User 
Defined Style" href="<?php echo 
(![b]$_COOKIES[/b]["sitestyle"])?'darkness':$_COOKIE["sitestyle"] ?>.css" />

Should be

Code:
<link rel="stylesheet" type="text/css" 
	media="screen" title="User 
Defined Style" href="<?php echo 
(!$_COOKIE["sitestyle"])?'darkness':$_COOKIE["sitestyle"] ?>.css" />
 
Dude, it looks fine. o_o The only thing that bothers me is the affiliates being a bit too much to the right, but that's in the other layout anyway.
 
it switches for me under firefox 3 and opera 9.5 so it's a problem with your browser, check your cookie settings

also regretfully CSS isn't my forté, I guess I'll take a look at it though
 
Yes, but it goes away after a few seconds.

If you don't mean that, then I think it's that the right row isn't aligned right.
 
Opps didn't see that.
My bad. ;(
Oh but I do see something!
I dont get why you use a "Absol fan"
Icon as your avatar for cutenews,
Because the point of them is to link to
the fan page but I see no link..
I mean sure we all like Absols and all
but then you shoudl link back
me says.
 
Back
Top Bottom