I need to put this code on my site
<?
$random_number = rand(1,4);
if($random_number == 1){
echo "http://www.mysite.com/geek.jpg";
}
?>
I could not do it anywhere, i tried in index.php and it is not used or my site is offline if I use <?
Yes I just want to serve the images to random selected people. I tried to post it in module but it was stripped out, and on index.php also did not work.
I put it in the footer file of my template, the code looks like this
<?php
$random_number = rand(1,4);
if($random_number == 1){
echo '<img src="/layout/professional/images/logo-top.gif" />';
}
?>
and the image does not show up, if I look at he souce the exact code is displayed
For example how can I show banner image to every forth person, is it possible?
I tried again
I ve put this code this time
function phpblock_showpic () {
$random_number = rand(1,4);
if($random_number == 1){
echo '<img src="/layout/professional/images/logo-top.gif" />';
}
}
and then create new block select it as php block and put phpblock_showpic in the appropriate field
the block does not show up at all
Garfy,
You need to edit your theme if you want your "block" on every pages.
For exemple you can add this code where you need it (header.html, footer.html, leftblocks.html, rightblocks.html...)
Garfy,
You need to edit your theme if you want your "block" on every pages.
For exemple you can add this code where you need it (header.html, footer.html, leftblocks.html, rightblocks.html...)