Random Image Script

Started on the old forum in August 2007 · view the original in the archive · old links redirect here

19 replies · 1,475 views · started 19 years ago · 1 min read

6 participants
nclemale36 Lead · 537 posts #1

i have this piece of code which selects images randomly from a folder. it works fine on a page ith nothing else on but when i try to add it to say for example a login page wer a logo shows all i get is the image and the rest of the stuff is wiped .

tried putting it in various places of the various script but it keeps wiping out the page and only shows the image. .

can anyone help me as to wer to put it

Attachments: random_image.php
crazybrumi Super moderator Principal · 1,064 posts #3
<?
$xfile = @file("pic.txt");
$random_num = rand (0,count($xfile)-1);
$udata = explode("::",$xfile[$random_num]);
echo $udata[1]; //a random text line from the text file will be displayed
?>

name this files as pic.php then follow next step than u should b dun

Visit My Website

Want something coded email me at sales@webnwaphost.com for a prices.

http://flagcounter.com/more/W80q

crazybrumi Super moderator Principal · 1,064 posts #4
::  [img]logo.jpg[/img]
::  [img]flag.jpg[/img]
::  [img]england.jpg[/img]
::  [img]1.jpg[/img]
::  [img]2.jpg[/img]

name this files as pic.txt, and replace the logo.jpg bit to were the pic u want is saved in if its in a folder remember / is for the folder, Note the :: must stay there or else it wont workand wala u should now have radom pics, any probs jus ask

Visit My Website

Want something coded email me at sales@webnwaphost.com for a prices.

http://flagcounter.com/more/W80q

blackhowk Senior · 411 posts #5

i have this piece of code which selects images randomly from a folder. it works fine on a page ith nothing else on but when i try to add it to say for example a login page wer a logo shows all i get is the image and the rest of the stuff is wiped .

tried putting it in various places of the various script but it keeps wiping out the page and only shows the image. .

can anyone help me as to wer to put it

http://www.2wap.org/forums/index.php?autom...ail&f_id=67

wbafc #7

ent that simular to myn jus slighly different coding ?

mr no all not lol

wbafc #11

yeh basically

who the hell u calling a slapper little boy?

wbafc #12

who the hell u calling a slapper little boy?

btw brumi dont u ever come bk on my site trying 2 put errors on there lol ha i court u out u didt think i would no who u was did ya little boy DONT PKAY YA GAMES WITH ME

metulj Super moderator Principal · 1,726 posts #13

btw brumi dont u ever come bk on my site trying 2 put errors on there lol ha i court u out u didt think i would no who u was did ya little boy DONT PKAY YA GAMES WITH ME

External image (may be gone) you mind to NOT argue here? and sort your problems elsewhere..thank you External image (may be gone)

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ノ刀ノイリ!

ibro9801 #16

you can put here some text

echo "<img src=\"$image_folder/$image_name\" alt=\"$image_name\" />";

for example

echo "This is the random image:<img src=\"$image_folder/$image_name\" alt=\"$image_name\" />";

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close