50 users online (0 members and 50 guests)  


Page 2 of 2 First 1 2
  Results 16 to 22 of 22

Related

  1. Random Images    Forum: PHP Forum
    Replies: 1
  2. Random Images using CSS files    Forum: CSS Forum
    Replies: 3
  3. Random Images Advanced    Forum: HTML Forum
    Replies: 4
  4. random images php script    Forum: PHP Forum
    Replies: 3
  1. #16
    ALL's Avatar
    Super Dooper Nerd

    Status
    Offline
    Join Date
    Feb 2005
    Location
    localhost
    Posts
    382

    Re: multiple random images

    oops...

    i forgot to put the $ on it... try this insted:
    Code:
    $temp0 = $randnum[$i];
    $temp1 = $files[$temp0];
    //then put this in the expression:
    echo "bla bla bla $dir$temp1 bla bla bal..."

  2. #17
    pegboy's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Aug 2001
    Location
    Knoxville, TN
    Posts
    76

    Re: multiple random images

    yea, i caught that... but still no go.
    robert koons

  3. #18
    ALL's Avatar
    Super Dooper Nerd

    Status
    Offline
    Join Date
    Feb 2005
    Location
    localhost
    Posts
    382

    Re: multiple random images

    you know, i think i may have found it, but not sure, try this:
    Code:
    <table width="175" height="1" border="0" cellpadding="0" cellspacing="0" class="left">
    <tr>
    <td height="1" background="images/left_border.gif"><img src="images/spacer" width="175" height="1"></td>
    </tr>
    <tr>
    <td align="center" valign="top">
    <img src="images/left_rule.gif" width="170" height="1" vspace="3"></td>
    </tr><?
    $dir = 'images/left/';
    $dh = opendir($dir);
    
    while (false !== ($filename = readdir($dh))) {
    if($filename == "Thumbs.db" || is_dir($filename)){
    }else{
    $files[] = $filename;
    }
    }
    $nooffildi = count($files);
    $nooffiles = ($nooffildi-1);
    srand((double)microtime()*100000);
    for($i=0; $i<=2; $i++){
    $randnum[$i] = rand(0,$nooffiles); 
    while($files[$randnum[$i]] == ""){
    $randnum[$i] = rand(0,$nooffiles);
    }
    ecno "<tr>\n
    <td align=\"center\" valign=\"top\"><img src=$dir{$files[$randnum[$i]]} width=\"175\" border=\"0\" class=\"iborder\"></td>\n
    </tr>\n
    <tr>\n
    <td align=\"center\" valign=\"top\"><img src=\"images/left_rule.gif\" width=\"170\" height=\"1\" vspace=\"3\"></td>\n
    </tr>\n";
    }
    echo "</table>\n";
    that is how they show it in some other places. so that should work

  4. #19
    pegboy's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Aug 2001
    Location
    Knoxville, TN
    Posts
    76

    Re: multiple random images

    the images are loading now, but occationally it's still loading the same image twice. check it out.
    http://www.document-pros.com/left.php
    robert koons

  5. #20
    ALL's Avatar
    Super Dooper Nerd

    Status
    Offline
    Join Date
    Feb 2005
    Location
    localhost
    Posts
    382

    Re: multiple random images

    woops, i must have missed a line, use this insted:
    Code:
    <table width="175" height="1" border="0" cellpadding="0" cellspacing="0" class="left">
    <tr>
    <td height="1" background="images/left_border.gif"><img src="images/spacer" width="175" height="1"></td>
    </tr>
    <tr>
    <td align="center" valign="top">
    <img src="images/left_rule.gif" width="170" height="1" vspace="3"></td>
    </tr><?
    $dir = 'images/left/';
    $dh = opendir($dir);
    
    while (false !== ($filename = readdir($dh))) {
    if($filename == "Thumbs.db" || is_dir($filename)){
    }else{
    $files[] = $filename;
    }
    }
    $nooffildi = count($files);
    $nooffiles = ($nooffildi-1);
    srand((double)microtime()*100000);
    for($i=0; $i<=2; $i++){
    $randnum[$i] = rand(0,$nooffiles); 
    while($files[$randnum[$i]] == ""){
    $randnum[$i] = rand(0,$nooffiles);
    }
    ecno "<tr>\n
    <td align=\"center\" valign=\"top\"><img src=$dir{$files[$randnum[$i]]} width=\"175\" border=\"0\" class=\"iborder\"></td>\n
    </tr>\n
    <tr>\n
    <td align=\"center\" valign=\"top\"><img src=\"images/left_rule.gif\" width=\"170\" height=\"1\" vspace=\"3\"></td>\n
    </tr>\n";
    $files[$randnum[$i]] = "";
    }
    echo "</table>\n";

  6. #21
    pegboy's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Aug 2001
    Location
    Knoxville, TN
    Posts
    76

    Re: multiple random images

    No, ALL! Thou shalt always go for greatness.

    thanks bro!
    robert koons

  7. #22
    ALL's Avatar
    Super Dooper Nerd

    Status
    Offline
    Join Date
    Feb 2005
    Location
    localhost
    Posts
    382

    Re: multiple random images

    no problem



Page 2 of 2 First 1 2

Tags for this Thread