Page 1 of 1

Parse Error

Posted: Tue Jul 06, 2010 3:04 pm
by tulsaimagery
I am trying to make a link open up a popup window when clicked and I am getting an error. This was working fine when I just did an href to another page but once I added in this java code to go to a popup window I started getting an error. I do not know enough about it to know what it is I need to fix to make it work. I would appreciate any help.


<?php if($custom_27 != '') { echo '
<div id="listing_offer">'.'<a href="JavaScript:newWindow('/terms_of_service.php','popup',550,450,'')">'.$custom_27.'</a>'.'</div>'; } ?>


Error that I get:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /home/tuls**/public_html/**/**/***.tpl on line 32

Re: Parse Error

Posted: Tue Jul 06, 2010 3:13 pm
by Jade
Your echo statement has a comma in it and you need to escape the single quotes in your javascript.

Code: Select all

<?php
if($custom_27 != '') {
   echo '<div id="listing_offer"><a href="JavaScript:newWindow(\'/terms_of_service.php\',\'popup\',550,450,\'\')">$custom_27</a></div>'; 
} 
?>

Re: Parse Error

Posted: Tue Jul 06, 2010 4:40 pm
by tulsaimagery
Thanks I got it working