MAMEWorld >> Programming
View all threads Index   Flat Mode Flat  

GatKong
Tetris Mason
Reged: 04/20/07
Posts: 5906
Loc: Sector 9
Send PM
Any php wisemen?
02/09/14 11:22 AM


specifically in a php block of simple portal 2.3.5 in Simple Machines Forum 2.0.7.

I want to display a random image from a folder.


Code:



$dir = 'http://mywebsite.com/random';
$images = glob($dir. '*.{jpg,jpeg,png,gif}', GLOB_BRACE);
$randomImage = $images[array_rand($images)];

echo '';

?>



Huh. The inequality brackets apparently work even when in a code-box... the code that is not displayed is:
inequality-bracket img src="'.$dir.$randomImage.'" width=89 inequality-bracket

Meh. It only displays a missing image placeholder, not unlike the one echoing above .

It's so simple... yet so not working.

Any help?




p.s. I couldn't post this subject line because it says no profanity...
"Any php gurus?"
LOL... what profanity? Is php so bad it's a three letter four-letter-word?

edit: oh...





Edited by Gatinho (02/09/14 11:31 AM)







Entire thread
Subject Posted by Posted on
* Any php wisemen? GatKong 02/09/14 11:22 AM
. * Re: Any php wisemen? krick  02/09/14 06:38 PM
. * Re: Any php wisemen? GatKong  02/09/14 11:41 PM
. * Re: Any php wisemen? krick  02/09/14 11:54 PM
. * Re: Any php wisemen? GatKong  02/10/14 03:24 AM

Extra information Permissions
Moderator:  Pi 
0 registered and 45 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 2844