Jump to content

Parse error: syntax error help


RonTal

Recommended Posts

I am a complete noobie... Hopefully you can help me figure out what I am doing wrong. I am trying to install a live chat feature (webim) to my online store. I created a new info box (which I have done many times before), and pasted the code I got, but I get the following error:

 

Parse error: syntax error, unexpected T_STRING, expecting ')' in /home/nook/public_html/templates/default/boxes/custom.php on line 39

 

Here is line 39:

'text'  => '<!-- webim button --><a href="/webim/client.php?locale=en" target="_blank" onclick="if(navigator.userAgent.toLowerCase().indexOf('opera') != -1

 

And here is the entire code:

 

<?php

/*

  Card Infobox, v 1.0 2002/12/04 by Kevin Park

 

  osCommerce

  http://www.oscommerce.com/

 

  Copyright © 2000,2001 osCommerce

 

  Released under the GNU General Public License

 

 

  CRE Loaded , Open Source E-Commerce Solutions

  http://www.creloaded.com

 

  Chain Reaction Works, Inc

  Portions: Copyright © 2005 - 2006 Chain Reaction Works, Inc.

 

  Last Modified by $Author$

  Last Modifed on : $Date$

  Latest Revision : $Revision:$

 

*/

?>

<!-- d Card Info Box //-->

          <tr>

            <td>

<?php

  $info_box_contents = array();

  $info_box_contents[] = array('align' => 'left',

                              'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CUSTOM . '</font>'

                              );

  new infoBoxHeading($info_box_contents);

 

  $info_box_contents = array();

  $info_box_contents[] = array('align' => 'center',

//                              'text'  => tep_image(DIR_WS_IMAGES . '/cards/cards.gif') .

//elari chanegd to provide a link to your payment acount

                              'text'  => '<!-- webim button --><a href="/webim/client.php?locale=en" target="_blank" onclick="if(navigator.userAgent.toLowerCase().indexOf('opera') != -1 && window.event.preventDefault) window.event.preventDefault();this.newWindow = window.open('/webim/client.php?locale=en&url='+escape(document.location.href)+'&referrer='+escape(document.referrer), 'webim', 'toolbar=0,scrollbars=0,location=0,status=1,menubar=0,width=640,height=480,resizable=1');this.newWindow.focus();this.newWindow.opener=window;return false;"><img src="/webim/button.php?image=webim&lang=en" border="0" width="163" height="61" alt=""/></a><!-- / webim button -->'

                              );

 

new infoBox($info_box_contents);

if (TEMPLATE_INCLUDE_FOOTER =='true'){

    $info_box_contents = array();

      $info_box_contents[] = array('align' => 'left',

                                    'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')

                                  );

new infoboxFooter($info_box_contents, '' );

}

?>

</td></tr>

<!-- d card_eof //-->

 

 

Thank you in advance!

Ronny

Link to comment
Share on other sites

'text'  => '<!-- webim button --><a href="/webim/client.php?locale=en" target="_blank" onclick="if(navigator.userAgent.toLowerCase().indexOf(\'opera\') != -1

 

try this instead

 

the problem is, you OPEN your string with ', therefore you can't use it INSIDE your string, without escaping it with a \ before it

Link to comment
Share on other sites

It is the same thing again. You tend to use singe quotes inside a quoted statement.

 

If You quote something with ' then all the ' used inside should be escaped, like Russel said.

So put \ in front of the ' that are inside you command.

Link to comment
Share on other sites

Is this correct then? It didn't work either. I just copied and pasted the code I got for the live chat button and pasted it in between the two ' I had. Any idea?

 

 

'text'  => '<!-- webim button --><a href="/webim/client.php?locale=en" target="_blank" onclick="if(navigator.userAgent.toLowerCase().indexOf(\'opera\') != -1 && window.event.preventDefault) window.event.preventDefault();this.newWindow = window.open(\'/webim/client.php?locale=en&url='+escape(document.location.href)+\'&referrer=\'+escape(document.referrer), \'webim\', \'toolbar=0,scrollbars=0,location=0,status=1,menubar=0,width=640,height=480,resizable=1\');this.newWindow.focus();this.newWindow.opener=window;return false;"><img src="/webim/button.php?image=webim&lang=en" border="0" width="163" height="61" alt=""/></a><!-- / webim button -->'

                              );

Link to comment
Share on other sites

try this:

 

'text'  => '<!-- webim button --><a href="/webim/client.php?locale=en" target="_blank" onclick="if(navigator.userAgent.toLowerCase().indexOf(\'opera\') != -1 && window.event.preventDefault) window.event.preventDefault();this.newWindow = window.open(\'/webim/client.php?locale=en&url=\'+escape(document.location.href)+\'&referrer=\'+escape(document.referrer), \'webim\', \'toolbar=0,scrollbars=0,location=0,status=1,menubar=0,width=640,height=480,resizable=1\');this.newWindow.focus();this.newWindow.opener=window;return false;"><img src="/webim/button.php?image=webim&lang=en" border="0" width="163" height="61" alt=""/></a><!-- / webim button -->'

                              );

 

And can You tell us what the error says?

Install FireBug in Firefox it helps for solving errors ;)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.