Jump to content

Need Help in CSS BackGround From PHP Random Image Script


karpagam

Recommended Posts

Hi All..

 

        Can you give me an idea about how to generate random Background images in php? I am having two files currently now. One is index.php and another one is style.css. I called the bg image css file in index.php. Now it showed me that bg image in front end. Likely, I have to generate random bg images in that.

 

I tried the below coding..

 

<div id="bgImg" style="background:url(/images/<?php "img_".rand(0,1000).".gif"; ?>) no-repeat top left;">aaaaaaa</div>

 

But its not going into PHP statement. Its not working.

 

How to do tat? Anyone please tell me..

 

 

 

Thanks in advance.........

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.