PHP newbie needs help...
- Started
- Last post
- 6 Responses
- chivas0
function get_img($page) {
switch($page) {
case is_home():
$pic_num="0";
break;
case 48:
$pic_num="1";
break;
case 50:
$pic_num="2";
break;
case 52:
$pic_num="3";
break;
case 54:
$pic_num="4";
break;
default:
$pic_num="5";
break;
}
return bloginfo('template_url') . '/img/pic-sidebar' . $pic_num . '.gif';
}// call an image like this
echo '<img src="' . get_image(48) . '" width="200" name="MyImage" />';
- Sep0
Thanks Chivas, but I can't get it to work. I try to call to the function as a mouseout event...
onMouseOut="?"
Any thoughts?
But thanks anyway!
- vaxorcist0
some php installations need <?php rather than just <?
- chivas0
I think the PHP4 and 5 no longer require the full <?php tag
- section_0140
I always use <?php ?> . Better safe than sorry (although a search and replace could fix it pretty easy).