Results 1 to 2 of 2

Thread: Random pics

  1. #1
    Join Date
    Feb 2005
    Posts
    6

    Default Random pics

    How can I make the main page show different pics when someone enters my website?

    Piarco.bizhat.com

  2. #2
    Join Date
    Feb 2005
    Posts
    12

    Default

    hmm.... I would suggest a php, because javascript is affected by the different browsers...

    I guess you could just use an array, with the locations of the pics inside. Then you could just have it echo the picture to the screen, like this:

    <?
    $picarray = array();

    $picarray[0] = "pic location 1";
    $picarray[1] = "pic location 2";
    $picarray[2] = "pic location 3";
    $picarray[3] = "pic location 4";

    $random = rnd(0, count($picarray));
    $rpicture = $picarray[$random];

    echo "[img]$rpicture[/img]";

    ?>

    that should work :D

    hixy

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •