Hello, I've been searching for a code that can change my website background image randomly when someone reloads the page but couldn't find anything. What I'm exactly looking for is for a code that will change the background of a table randomly to another one when someone reloads the page, but, I don't want it to change every time someone reloads the page, as I said, I need it to be randomly, and I mean that sometimes the background can just stay at the same one. For now I'm using a single image as background, without a rotating code: <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" background="./template/default/images/bg.jpg" style="background-repeat:no-repeat; background-position:center; background-position:top"> Code (markup): What I want to do is something that will change that background path "./template/default/images/bg.jpg" to another one, like "./template/default/images/bg2.jpg" or something like that when someone reloads the page. Thanks in advance.
Sorry for double posting but I found a solution. I just used this simple PHP code: $array[0] = './template/default/images/site_bg.jpg'; $array[2] = './template/default/images/bg.jpg'; shuffle($array); Code (markup): and changed the table code to this one: <table width=\"100%\" height=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" background=\" ". "$array[0]" ." \" style=\"background-repeat:no-repeat; background-position:center; background-position:top\"> Code (markup): and that did the rotation I needed. for this i searched on google for " background change onload " .