# Php in js - rollover path

**URL:** <https://forum.kirupa.com/t/php-in-js-rollover-path/75041>\
**Category:** Uncategorized\
**Created:** [January 5, 2005, 3:00pm UTC](https://forum.kirupa.com/t/php-in-js-rollover-path/75041 "2005-01-05T15:00:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmplx](https://avatars.discourse-cdn.com/v4/letter/c/7cd45c/32.png) [@cmplx](https://forum.kirupa.com/u/cmplx)\
**Post date:** [January 5, 2005, 3:00pm UTC](https://forum.kirupa.com/t/php-in-js-rollover-path/75041/1 "2005-01-05T15:00:52Z")

</div>

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.
