I have a function. Basically, this is to save me a lot of typing with dynamically created images. I create two images, one is "off" and the other is "on" for swapping onMouseOver.
However, this is a particular button that I"m trying to single out within the function. It's the inbox button. If they have new messages, it's supposed to add " - $nmesses new". It adds everything but the number contained in $nmesses.
I've tested $nmesses by just echoing it on the page, and it holds the right value, but it won't show up in the image. Can someone please tell me what's going on before I lose it, I can't find any explanation for it.
| Code: |
function makesourceimage ($thetext, $theimage, $theform) { echo "<a onClick = 'document.".$theform.".submit();' onMouseOver='document.".$theform.$theimage."off.style.display = \"none\"; document.".$theform.$theimage."on.style.display=\"block\";' onMouseOut = 'document.".$theform.$theimage."off.style.display=\"block\"; document.".$theform.$theimage."on.style.display =\"none\";'><img name='".$thetype.$theimage."off' id = '".$theform.$theimage."off' src = '".$theimage."off.php?buttontext=".$thetext.""; if ($theform == 'inbox') { if ($nmesses == '0') {} else { echo " - "; echo "$nmesses"; echo " new"; } } |