Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Images

Random SWF animation

images php coding issues or problems here.

Moderators: macek, egami, gesf

Random SWF animation

Postby zeehkaev » Sun Jun 26, 2011 7:15 pm

I need help.
I am not as "allnewbie" in PHP but I don't know how to do this.

Basically I have 4 cool animations (.swf) all in the same folder. Whenever the main page of the Gaming WebSite opens "main_01.swf" is displayied as a banner
I'd like to create a script where these 4 swf (Main_0*.swf) randomly change whenever the user open the page...
Anyone can help me ?
New php-forum User
New php-forum User
Posts: 1
Joined: Sun Jun 26, 2011 6:58 pm

Re: Random SWF animation

Postby Tacticious » Mon Jun 27, 2011 2:46 pm

Code: Select all
//Random integer, 1 to 4
$swf = rand(1, 4);

//Convert the integer to a path to the randomly picked SWF
$swf = "Main_0" . $swf. ".swf";
New php-forum User
New php-forum User
Posts: 4
Joined: Mon Jun 27, 2011 1:06 pm

Return to PHP coding => Images

Who is online

Users browsing this forum: Google [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.