Welcome Guest, Not a member yet? Register   Sign In
PHP in CSS file
#6

[eluser]John_Betong[/eluser]
Hi Kemik,
 
>>> PHP’s rand() function would be great to select a random middle_banner.
>>> I was going to do middle_banner_<?php rand(2, 6) ?>.jpg
 
I recently introduced this code so that the 1676x76px smiley banner starts at a different position each time the page is loaded.
Code:
<body>
   ...
   ...
    <?php $X = 20 * rand(0,80) ?>    
    <div style='clear:both; background:transparent url(/afiles/logo/la_1676x72.jpg) -&lt;?php echo $X ?&gt;px 0 repeat-x'>
    </div>  
   ...
   ...
&lt;/body&gt;
&nbsp;
You can see it here
&nbsp;
&nbsp;


Messages In This Thread
PHP in CSS file - by El Forum - 06-17-2008, 12:15 PM
PHP in CSS file - by El Forum - 06-17-2008, 01:00 PM
PHP in CSS file - by El Forum - 06-17-2008, 01:12 PM
PHP in CSS file - by El Forum - 06-17-2008, 01:31 PM
PHP in CSS file - by El Forum - 06-17-2008, 04:54 PM
PHP in CSS file - by El Forum - 06-17-2008, 09:07 PM



Theme © iAndrew 2016 - Forum software by © MyBB