Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Code error in product_info.php (I think...)


Nerf-Herder

Recommended Posts

Posted

OK, This all started when I noticed that Explorer and Firefox were working, but spitting errors refering to all products.

Firefox says:

unterminated string literal

document.write('<br style="line-height:10px;"> and points between the two bolded characters: ...write('<br...

 

Explorer says:

Line: 483

Char: 47

Error: Unterminated string constant

Code:0

URL: http:///www.[sitename].com/product_info.php/product_id/##

 

I was able to locate the code Firefox was complaining about only in the product_info.php, so I'm guessing that this is where it is.

 

The code is actually located between lines 162 and 165 (in my hacked store) and looks like this:

<script type="text/javascript"><!--

document.write('<?php echo '<br style="line-height:10px;">

<div><a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . TEXT_CLICK_TO_ENLARGE . '</a></div>'; ?>');

//--></script>

 

I have NO idea what the problem might be, or how to resolve it, but have the feeling that it's probably something you guys can help me with. Any takers?

 

I really appreciate any assistance you can provide. The site is up and everything seems to be working, but this error is going to drive me crazy. You know how it is... :rolleyes:

 

Thanx for all your help!

Jon-

Posted

It's a Javascript error, not a PHP error.

 

You'll need to give someone a link to actually pull up the page in their browser to help find the problem.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted
It's a Javascript error, not a PHP error.

 

You'll need to give someone a link to actually pull up the page in their browser to help find the problem.

 

You can get to the page by visiting:

www.swsstore.com and clicking on any product.

Thank you for getting back! It's greatly appreciated. :)

 

Jon-

Posted

The code you posted is indeed the problem.

 

<script type="text/javascript"><!--
document.write('<?php echo '<br style="line-height:10px;">
<div><a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . TEXT_CLICK_TO_ENLARGE . '</a></div>'; ?>');
//--></script>

In your PHP source the middle two lines need to be on one long line with a \n between them like this:

 

<script type="text/javascript"><!--
document.write('<?php echo '<br style="line-height:10px;">\n<div><a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . TEXT_CLICK_TO_ENLARGE . '</a></div>'; ?>');
//--></script>

The forum will make them appear like they are one two lines. It needs to be one long line.

 

It's always a good idea to make a backup of any file before making any edits.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...