Well i have a box then i want everytime somone refresh it changes colour
I have Blue, Green red
Divs
bluetop, bluemid, bluebot,
greentop, greenmid, greenbot
redtop, redmid, redbot
is there anyway i can do this?

Well i have a box then i want everytime somone refresh it changes colour
I have Blue, Green red
Divs
bluetop, bluemid, bluebot,
greentop, greenmid, greenbot
redtop, redmid, redbot
is there anyway i can do this?
Lets make the map red again
T4 on the beach 2009 woo
Need help PM me Im always happy to help, more then the guys at Asda
Something like this...?
Code:<?php $random_color = rand(1,3); if ($random_color == 1) { $color = 'blue'; } elseif ($random_color == 2) { $color = 'green'; } else { $color = 'red'; } echo '<div class="'.$color.'top"></div>'; echo '<div class="'.$color.'mid"></div>'; echo '<div class="'.$color.'bot"></div>'; ?>
That would cause the same colour to be shown in a row occasionally?Something like this...?
Code:<?php $random_color = rand(1,3); if ($random_color == 1) { $color = 'blue'; } elseif ($random_color == 2) { $color = 'green'; } else { $color = 'red'; } echo '<div class="'.$color.'top"></div>'; echo '<div class="'.$color.'mid"></div>'; echo '<div class="'.$color.'bot"></div>'; ?>
There would be a way via Cookies where it will choose a different colour than the last time.
That is if your bothered about the same colour showing.
Code:<?php session_start(); $color = $_SESSION['color']; if ($color == '') { $color = 'blue'; $_SESSION['color'] = 1; } elseif ($color == 1) { $color = 'green'; $_SESSION['color'] = 2;$ } elseif ($color == 2) { $color = 'red'; $_SESSION['color'] = ''; } echo '<div class="'.$color.'top"></div>'; echo '<div class="'.$color.'mid"></div>'; echo '<div class="'.$color.'bot"></div>'; ?>
Want to hide these adverts? Register an account for free!