vanvoquan Posted November 15, 2010 Share Posted November 15, 2010 Hi everybody. I have this little code but it give me the error. I spent hours to change the period, comma, semi-colon, etc... but no hope. It make me crazy. Can any php expert show me where I have missing a period, a comma or if I have forgot something? Million thanks to you. <script language="javascript"> document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')" onMouseover="changeimage(myimages[0],this.href)"><?php if (tep_not_null($products_options_name_cuong['pc_1'])) { ?><?php echo tep_image(DIR_WS_IMAGES. $products_options_name_cuong['pc_1']); ?><?php } ?></a>' ; ?>'); </script> Quote Link to comment https://forums.phpfreaks.com/topic/218704-getting-syntax-error-please-help/ Share on other sites More sharing options...
revraz Posted November 15, 2010 Share Posted November 15, 2010 You have single quotes in single quotes. Fix the PHP first, then incorprate the Javascript. Use carriage returns in your code so people can see it. Quote Link to comment https://forums.phpfreaks.com/topic/218704-getting-syntax-error-please-help/#findComment-1134376 Share on other sites More sharing options...
vanvoquan Posted November 15, 2010 Author Share Posted November 15, 2010 I change the single quote to doule quote but still nothing happen. I still got the error: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/cuong11/public_html/theknowledgers.com/product_info.php on line 199 Quote Link to comment https://forums.phpfreaks.com/topic/218704-getting-syntax-error-please-help/#findComment-1134562 Share on other sites More sharing options...
Pikachu2000 Posted November 15, 2010 Share Posted November 15, 2010 You have 4 <?php open tags, and only 3 ?> close tags. Quote Link to comment https://forums.phpfreaks.com/topic/218704-getting-syntax-error-please-help/#findComment-1134567 Share on other sites More sharing options...
vanvoquan Posted November 15, 2010 Author Share Posted November 15, 2010 Thanks Pikachu2000. After carefully examination, I put one more close tag up there and it work smoothly. Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/218704-getting-syntax-error-please-help/#findComment-1134583 Share on other sites More sharing options...
Pikachu2000 Posted November 15, 2010 Share Posted November 15, 2010 Excellent. Quote Link to comment https://forums.phpfreaks.com/topic/218704-getting-syntax-error-please-help/#findComment-1134595 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.