johnny81 Posted February 8, 2010 Share Posted February 8, 2010 Hello, I am atempting to create my header to display a random .jpg each time the page is refreshed but cannot seem to get it to work.I have created header.php <?php $ban1 = "./img/logo01.jpg";$ban2 = "./img/logo02.jpg";$ban3 = "./img/logo03.jpg";$randomNum = rand (1,3);$image = ${'ban'.$randomNum};Print "";?> and I have this located in the same directory as header.tpl which I have edited in the <!-- Header section --> <?php include("header.php"); ?> {$HOOK_TOP} is there something I am doing incorrect, or is there a way to achieve what I am trying to do ?RegardsJohnny Link to comment Share on other sites More sharing options...
rocky Posted February 8, 2010 Share Posted February 8, 2010 I think you're doing it the hard way. You simply need to change line 47 of header.tpl from: to: This will choose a random image from logo1.jpg, logo2.jpg and logo3.jpg. Link to comment Share on other sites More sharing options...
johnny81 Posted February 8, 2010 Author Share Posted February 8, 2010 perfect exactly what I want. Thankyou Rocky Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now