Hi,
I'm new here and to PHP, just trying to get some good PHP knowledge. It'd be nice if I could receive any sort of help.
I am having trouble making a code piece work:
PHP Code:
<?php
function onMouseOver()
{
echo "<script type='text/javascript'>window.alert('Mouseover called')</script>";
}
?>
<a href='blahblah.php' onmouseover='"<?php onMouseOver() ?>"'> <img name="item1" src="../aboutus.bmp" /></a>
In the code above, I'm simply trying to call the function onMouseOver(); using the onmouseover property from href. The problem is that the window.alert function is being called when I enter the page when it is supposed to call the window.alert function when I mouseover the image?
I even tried to put the whole code in php:
PHP Code:
<?php
function onMouseOver()
{
echo "<script type='text/javascript'>window.alert('Mouseover called')</script>";
}
?>
<?php echo "<a href='blahblah.php' onmouseover='".onMouseOver()."' > <img name='item1' src=../aboutus.bmp' /></a>" ?>
Still doesn't work? For some reason!

Any ideas, anyone?!
Edit: Nevermind, I found a workaround.