FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

run into pictures

 


bykezzap
<?
$lower = 1; // başlangıç numarası
$upper = 11; // bitiş numarası, toplam resim sayısı
$random_number = mt_rand($lower, $upper); // rasgele numara seç
$image = "$random_number.jpg"; // dosya adına dönüşüm

echo "<img src='images/$image' alt='$image' border='0'">
?>

run into picture for you....
neekhu
Yep, this should get you an image, located in the current folder in folder images.

But, I'd like to make some little modifications, better put it like this way:

echo "<img src=\"./images/".$image."\" alt=\"".$image."\" border=\"0\">";

Hehe Razz.

@bykezzap: Can you also give us a code to display an image located in a database?
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.