I need some idea how to random pic+txt...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    I need some idea how to random pic+txt...

    let's say i got pics marked from 1 to 50
    and i also hav txt files marked from 1 to 50

    how would i display randomly on each refresh
    pic+txt matching the number of both files ?
    (i know how to display random things...
    but how to match number of both files?)

    like.. if is random pic 1.jpg then at same time i need to display 1.txt...
    this might be easy to code but right now im really without idea lol

    btw... i dont need this for lava
    just general code or at least tip
    It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt.
    ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ !
    ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.
    キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

    #2
    PHP Code:
    <?php
    $rand 
    rand(1,50);
    ?>
    <img src="images/<?=$rand?>.png" alt=""/><br/>
    <?
    $tx = fopen("txts/$rand.txt", 'r');
    $dat = fread($tx,  filesize("txts/$rand.txt"));
    fclose($tx);
    echo $dat;
    ?>
    Last edited by something else; 05.07.10, 20:51.

    Comment

    Working...
    X