cmplx
January 5th, 2005, 10:00 AM
i'm trying to make a site that has rollovers coded in javascript, but want to be able to have the path for the images stored in a variable ($images_path) so i can modify according to different folders/levels i'm in.
i've been running into several parse errors.
here's what i tried with escape characters (lines 2-10 each onmouseover/down is its own line):
<?php
include
"<a href=\"$pages_path/index.php\"
onmouseover=\"changeImages('about', '$images_path/about_over.gif'); return true;\"
onmouseout=\"changeImages('about', '$images_path/about.gif'); return true;\"
onmousedown=\"changeImages('about', '$images_path/about_over.gif'); return true;\"
onmouseup=\"changeImages('about', '$images_path/about_over.gif'); return true;\">
<img name=\"about\" src=\"$images_path/about.gif\" width="78" height="22" border="0" alt=""></a>"
?>
however, i get a parse error:
Parse error: parse error, unexpected T_LNUMBER in /home2/whatthe/public_html/work/sunfood/pages/menu.php on line 9
line 9 is the <img> tag. not too sure what is causing this or if this is even or if this can even work with php inside a javascript.
anyone have any idea if this will work or if there's another work around to for this? thanks.
i've been running into several parse errors.
here's what i tried with escape characters (lines 2-10 each onmouseover/down is its own line):
<?php
include
"<a href=\"$pages_path/index.php\"
onmouseover=\"changeImages('about', '$images_path/about_over.gif'); return true;\"
onmouseout=\"changeImages('about', '$images_path/about.gif'); return true;\"
onmousedown=\"changeImages('about', '$images_path/about_over.gif'); return true;\"
onmouseup=\"changeImages('about', '$images_path/about_over.gif'); return true;\">
<img name=\"about\" src=\"$images_path/about.gif\" width="78" height="22" border="0" alt=""></a>"
?>
however, i get a parse error:
Parse error: parse error, unexpected T_LNUMBER in /home2/whatthe/public_html/work/sunfood/pages/menu.php on line 9
line 9 is the <img> tag. not too sure what is causing this or if this is even or if this can even work with php inside a javascript.
anyone have any idea if this will work or if there's another work around to for this? thanks.