if(!isset($_COOKIE['header_img'])) {
setc("header_img", '2');
reloc($_SERVER['REQUEST_URI']);
}
echo "Before: " . $_COOKIE['header_img'];
switch ($_COOKIE['header_img']) {
case '1':
setc("header_img","2");
break;
case '2';
setc("header_img","1");
break;
}
echo "After: " . $_COOKIE['header_img'];
further down the page:
[CODE] <?php
switch ($_COOKIE['header_img']) {
case '1':
echo '<img src="/themes/gear/images/ico.big/earth.png" alt="Earth"></img>';
break;
case '2';
echo '<img src="/themes/gear/images/ico.big/gear.png" alt="Gear"></img>';
break;
}
?>[/CODE]
setc() is basically a function i made so it was easier to write out setcookie without messing something up.
The image in the second block of code on this post, won't change the image, it stays as 1 all the time.
I don't need to reload the page in the first switch case because i'm setting the value to the next # for whenever someone changes the page yet again. Any helps appreciated.