000
13.07.2004, 13:16
--LuCkSh0T--
|
jo die überschrift sagt eigentlich alles kann mir jemand n link zu so nem tutorial/tool geben, oder unter umständen mir sogar hier erklären wie man das macht.. thx schonmal
--
ich bin nicht faul, ich hab nur keine lust!
|
|
Profil || Suche
|
001
13.07.2004, 13:31
scus
|
php, javascript oder was?
in php:
<?php $picnum = $anzahlanbildern; $rand = rand(0, $picnum); echo "<img src="pfad/zu/bild/bild_nr".$rand.".jpg" alt="ein rand bild">"; ?>
so müssten die bilder allerdings bild0.jpg, bild1.jpg, ... , bild10.jpg, bild11.jpg etc. heissen...
--
sincères amitiés scus -- Tand, Tand ist das Gebilde von Menschenhand
|
|
Profil || Suche
|
002
13.07.2004, 14:01
K-Putt
|
Hab das bei mir so gelöst (in PHP), wenn du eine ungewisse Anzahl an Bildern hast:
<?php $files = array(); srand ((double)microtime()*1000000); $handle = opendir ("bilder_verzeichnis"); while(false !== ($file = readdir ($handle))) { if($file == "." || $file == "..") continue; $files[] = $file; } if(count($files)<=0) { echo "<p>(Momentan keine Bilder)</p>"; return; }
$number = rand(0, count($files)-1); #echo "<img src=\"".$files[$number]."\" alt=\"".$files[$number]."\" title=\"".$files[$number]."\" />"; Ausgeben des Bildes per $files[$number]. ?>
[edit] ai ai Bug im PHP-Highlighter :/
--
Rambo Engineer @ Drippy's 2fort - finest TFC 1.5 || Bild Upload || The world's most advanced open source database
Dieser Beitrag wurde am 13.07.2004 um 14:04 von K-Putt bearbeitet.
|
|
Profil || Suche
|