Hi, I'm getting a little stuck with using session variables. I can start a session ok, and then use this to strip out hyphens for dynamic keyword and image insertion. I can happily echo $MainKeyWord anywhere with alternative text. However, when i try and do similar with calling up an image I can't get the alternative filename (here it's 'default') to work: I'm basically trying to do this - if there is a session keyword then use the stripped down version of that ($picword) as the filename, else use default. It works ok with the session keyword but never shows the default image. I think the problem might be to do with not clearing the session variable properly, although maybe the snippet I've written is not suitable? Any ideas would be greatly appreciated, thanks, Bob
<img src="images/<?php if (!empty($_SESSION['KW'])) { echo $picword; } else { echo 'default'; } ?>.png" title="" alt="" /> PHP: If it doesn't work, $_SESSION['KW'] is always set and holds some value - clear it and the default image should appear as expected.