Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Tough Parse Error


patrickbailey1

Recommended Posts

Posted

I was adding a script edit to my new categories box and got this:

 

Parse error: parse error, unexpected T_STRING, expecting ')' in /hsphere/local/home/havenbiz/havenelectronics.com/catalog/includes/boxes/newcategories.php on line 87

 

 

Here's line 87:

 

	onmouseover="changeImages('rl1', 'i/rl1-over.jpg'); return true;"

 

Here's around line 87:

 

<tr>
    	 <td>
       <a href="#"
      	 onmouseover="changeImages('rl1', 'i/rl1-over.jpg'); return true;"
      	 onmouseout="changeImages('rl1', 'i/rl1.jpg'); return true;">
      	 <img name="rl1" src="i/rl1.jpg" width="208" height="27" border="0"></a></td>
     </tr>

Any ideas?

 

Patrick

Patrick Bailey

www.DisplayHaven.com

Posted

Parse errors have gotten me pretty good because the line being referenced is not usually where the problem is. For me it has been most commonly a missing "}" at the end of the appropriate line. If you added text check to see that the bracket is "closing" somewhere. Note that the message states

" expecting ')' " the paren could be the same problem, not closing a line somewhere. Good Luck ;)

 

Craig

Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

3 Vendors, each category, "buy" a product from each category to see how MVS works during checkout.

Multi Vendor Shipping V1.1 Demo Admin

login: [email protected]

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Posted

Here's the rest of the file, seems this may help:

 

<?php
/*
 $Id: newcategories.php,v 1.6 2003/02/10 22:31:00 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/
?>
<!-- newcategories //-->
         <tr>
           <td>
<?php
 $info_box_contents = array();
 $info_box_contents[] = array('text' => BOX_HEADING_NEWCATEGORIES);

 new infoBoxHeading($info_box_contents, false, false);

 $info_box_contents = array();
 $info_box_contents[] = array('text' =>'
<html>
<head>

<script language="JavaScript">
<!--

function newImage(arg) {
   if (document.images) {
       rslt = new Image();
       rslt.src = arg;
       return rslt;
   }
}

function changeImages() {
   if (document.images && (preloadFlag == true)) {
       for (var i=0; i<changeImages.arguments.length; i+=2) {
           document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
       }
   }
}

var preloadFlag = false;
function preloadImages() {
   if (document.images) {
       rl1_over = newImage("i/rl1-over.jpg");
       rl2_over = newImage("i/rl2-over.jpg");
       rl3_over = newImage("i/rl3-over.jpg");
       rl4_over = newImage("i/rl4-over.jpg");
       rl5_over = newImage("i/rl5-over.jpg");
       preloadFlag = true;
   }
}

// -->
</script>

<style type="text/css">
<!--
   body,td        { font-family: arial, helvetica; font-size: 11px; color: #A8A8A8; line-height: 14px; }
   body        { background-color: #41738A; }
   form        { margin: 0px; }
   input.text    { font-family: arial, helvetica; font-size: 11px; color: #333333; border: solid 1px; border-color: #858585; padding: 2px; }
   a        { color: #00BDFF; text-decoration: none; }
   a:hover        { text-decoration: underline; }
   .bottom        { color: #ffffff; }
   .sides        { background-color: #eeeeee; }
-->
</style>
</head>
<td><img src="i/spacer.gif" width="29" height="1"></td>
           <td valign="top">
               <table cellpadding="0" cellspacing="0" border="0">
               <tr>
                   <td>
                       <table width="208" border="0" cellpadding="0" cellspacing="0">
                       <tr>
                           <td>
                               <img src="i/a37.jpg" width="208" height="5"></td>
                       </tr>
                       <tr>
                           <td>
                               <a href="#"
                                   onmouseover="changeImages('rl1', 'i/rl1-over.jpg'); return true;"
                                   onmouseout="changeImages('rl1', 'i/rl1.jpg'); return true;">
                                   <img name="rl1" src="i/rl1.jpg" width="208" height="27" border="0"></a></td>
                       </tr>
                       <tr>
                           <td>
                               <img src="i/a48.jpg" width="208" height="1"></td>
                       </tr>
                       <tr>
                           <td>
                               <a href="#"
                                   onmouseover="changeImages('rl2', 'i/rl2-over.jpg'); return true;"
                                   onmouseout="changeImages('rl2', 'i/rl2.jpg'); return true;">
                                   <img name="rl2" src="i/rl2.jpg" width="208" height="27" border="0"></a></td>
                       </tr>
                       <tr>
                           <td>
                               <img src="i/a48.jpg" width="208" height="1"></td>
                       </tr>
                       <tr>
                           <td>
                               <a href="#"
                                   onmouseover="changeImages('rl3', 'i/rl3-over.jpg'); return true;"
                                   onmouseout="changeImages('rl3', 'i/rl3.jpg'); return true;">
                                   <img name="rl3" src="i/rl3.jpg" width="208" height="27" border="0"></a></td>
                       </tr>
                       <tr>
                           <td>
                               <img src="i/a48.jpg" width="208" height="1"></td>
                       </tr>
                       <tr>
                           <td>
                               <a href="#"
                                   onmouseover="changeImages('rl4', 'i/rl4-over.jpg'); return true;"
                                   onmouseout="changeImages('rl4', 'i/rl4.jpg'); return true;">
                                   <img name="rl4" src="i/rl4.jpg" width="208" height="27" border="0"></a></td>
                       </tr>
                       <tr>
                           <td>
                               <img src="i/a48.jpg" width="208" height="1"></td>
                       </tr>
                       <tr>
                           <td>
                               <a href="#"
                                   onmouseover="changeImages('rl5', 'i/rl5-over.jpg'); return true;"
                                   onmouseout="changeImages('rl5', 'i/rl5.jpg'); return true;">
                                   <img name="rl5" src="i/rl5.jpg" width="208" height="27" border="0"></a></td>
                       </tr>
                       <tr>
                           <td>
                               <img src="i/a61.jpg" width="208" height="6"></td>
                       </tr>
                       </table>
                   </td>
               </tr>
               <tr>
                   <td><img src="i/spacer.gif" width="1" height="28"></td>
               </tr>');
 new infoBox($info_box_contents);
?>
<!-- newcategories_eof //-->

 

No idea where the error is...dreamweaver seems to think its ok...i have no idea...

Patrick Bailey

www.DisplayHaven.com

Posted

Not sure how you have dreamweaver configured, but in mine it shows all kinds of errors.

 

This line starts here and goes on for a while. Inside the single quote though you have many other single quotes that need to be escaped.

 

For example:

 

<a href="#" onmouseover="changeImages('rl1', 'i/rl1-over.jpg'); return true;"
                  onmouseout="changeImages('rl1', 'i/rl1.jpg'); return true;">
                  <img name="rl1" src="i/rl1.jpg" width="208" height="27" border="0"></a></td>

 

Should be:

 

<a href="#" onmouseover="changeImages(\'rl1\', \'i/rl1-over.jpg\'); return true;"
                                  onmouseout="changeImages(\'rl1\', \'i/rl1.jpg\'); return true;">
                                  <img name="rl1" src="i/rl1.jpg" width="208" height="27" border="0"></a></td>

Posted

Maybe my dreamweaver configuration is wrong...that must be it if its telling you to put that in...it looks fine when i paste it in there...is that the only errors you found, is in those lines that look like that?

Patrick Bailey

www.DisplayHaven.com

Posted

Holy sweet buddha it worked! I gotta fix my dreamweaver...what type of page did you open up to view that code and how did you "check it"? Could you tell me for future 5 hour problems that frusterate me to the point of no return...?

 

Forever grateful!

 

Patrick

Patrick Bailey

www.DisplayHaven.com

Posted

Glad you got it worked out!

Craig. ;)

Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

3 Vendors, each category, "buy" a product from each category to see how MVS works during checkout.

Multi Vendor Shipping V1.1 Demo Admin

login: [email protected]

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Archived

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

×
×
  • Create New...