Can anyone tell me what is wrong with this php code. <? if($locationimage == '') { echo 'images/client_area.jpg'; } else { echo $locationimage; } ?> PHP: - Prilep
Nothing... what happens when you run it? And is that the whole code? Where does $locationimage come from?
It's not working. That code is suppose to echo that image images/client_area.jpg if there isn't one specified. But if there is it's suppose to put the image that is specified. $locationimage = 'images/cars.jpg - Prilep
Yes, I get the logic. But the code itself is correct. Does your host support short tags? Replace <? with <?php and see if it works.
Oh! Im an idiot lol. I made it as a comment thats why it wasn't working. See the // lol. // $locationimage = 'cars.jpg'; Thanks Green Rep added for the help. - Prilep