Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING


peacelight

Recommended Posts

No harm done with a little kidding around. All work and no play make for a dull day.

I appreciate the replies, thanks very much. I am still stuck on this problem. I get the following error when I include the code below on any page

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /home/OurServer/public_html/Shop/index.php on line 53

 

 <?php if (tep_session_is_registered('customer_id')){
echo '<td align="left" valign="middle">		  <a href="' . tep_href_link(FILENAME_LOGOFF, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_logoff.gif', HEADER_TITLE_LOGOFF) '</a></td>';} ?>

This is done in the context of the header.php file on a php 4.3+ server inside the code block

<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr class="header">
<td align="left" valign="middle"><?php echo '<a href="' . tep_href_link(DIR_WS_HTTP_SERVER) . '">' . tep_image(DIR_WS_IMAGES . 'shield.gif', 'Home') . '</a>'; ?></td>
	<?php if (tep_session_is_registered('customer_id')){
echo '<td align="left" valign="middle">		  <a href="' . tep_href_link(FILENAME_LOGOFF, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_logoff.gif', HEADER_TITLE_LOGOFF) '</a></td>';} ?>
<td align="left" valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', HEADER_TITLE_MY_ACCOUNT) . '</a>'; ?></td>
<td align="left" valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . tep_image(DIR_WS_IMAGES . 'header_cart.gif', HEADER_TITLE_CART_CONTENTS) . '</a>'; ?></td>
<td align="left" valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_CHECKOUT) . '</a>'; ?></td>
  </tr>
</table>

 

I am also have a problem with the line in which I am trying to call the index of the site

	<td align="left" valign="middle"><?php echo '<a href="' . tep_href_link(DIR_WS_HTTP_SERVER) . '">' . tep_image(DIR_WS_IMAGES . 'shield.gif', 'Home') . '</a>'; ?></td>

Cheers to all those with beers

Any and all help is appreciated

On your last day only you will have to approve or disaprove of how your life has been.

Link to comment
Share on other sites

<?php if (tep_session_is_registered('customer_id')){
echo '<td align="left" valign="middle">		  <a href="' . tep_href_link(FILENAME_LOGOFF, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_logoff.gif', HEADER_TITLE_LOGOFF) '</a></td>';} ?>

Should be:

 

<?php if (tep_session_is_registered('customer_id')){

echo '<td align="left" valign="middle"> <a href="' . tep_href_link(FILENAME_LOGOFF, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_logoff.gif', HEADER_TITLE_LOGOFF) . '</a></td>';} ?>

(Missing a period)

 

What's the probblem (error message?) with this code:

 

   <td align="left" valign="middle"><?php echo '<a href="' . tep_href_link(DIR_WS_HTTP_SERVER) . '">' . tep_image(DIR_WS_IMAGES . 'shield.gif', 'Home') . '</a>'; ?></td>

:unsure:

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 >

Link to comment
Share on other sites

If you wanted to "link to the index" of a site:

 

DIR_WS_HTTP_SERVER

 

Should probably be:

 

FILENAME_DEFAULT

 

The tep_href function automatically add what's defined for HTTP_SERVER (or HTTPS_SERVER) in front of what you pass as the 1st parameter, which is assumed to be a file name.

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 >

Link to comment
Share on other sites

Hello Again Jim,

Thanks for all of your help.

Ok the period fixed the parse error Yea! The problem that you asked about is that that table data isn't showing when I load the page, neither is the logoff one showing when I login to the cart.

It's always the small stuff.

thanks for catching my error.

On your last day only you will have to approve or disaprove of how your life has been.

Link to comment
Share on other sites

Care to post (or PM me) a URL so I can see for myself what's going on?

:unsure:

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 >

Link to comment
Share on other sites

Here is where you can take a look the FILENAME_DEFAULT gets you the top level of the cart which is not the index of the site in this case. I want to leave that alone in the filenames.php for all the other references to it I was thinking of trying to add another entry to the filenames.php but once again because I am not referencing a page that is with in the cart it always want to preface it with the http://www.domain.com/catalog/ So I just hard coded it which I consider a very rough hack. I mean what if someone else wants to change it? Even with the hard code the image still isn't showing.

On your last day only you will have to approve or disaprove of how your life has been.

Link to comment
Share on other sites

Ah Ha

Perfect example of not having relative links and the downfall of hard coding. This is on the testing server and the link refers to the domain of the production server, which is hot link protected.

That's why the main image isn't showing.

On your last day only you will have to approve or disaprove of how your life has been.

Link to comment
Share on other sites

If you look at the HTML source you see this:

 

<td align="left" valign="middle">		  <a href="https://secure29.inmotionhosting.com/~intern25/Shop/logoff.php"></a></td>

I peeked in your images folder...

 

There is no file named header_logoff.gif

 

That's why you don't see anything.

:blush:

 

You want some help getting rid of the "Do you want to display both secure and non-secure" message when you go SSL?

:unsure:

 

For the link to the "index" of the site you can use:

 

tep_href_link('/')

 

The link looks like this: http://www.site.com// but it works.

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 >

Link to comment
Share on other sites

You want some help getting rid of the "Do you want to display both secure and non-secure" message when you go SSL?

 

For the link to the "index" of the site you can use:

 

tep_href_link('/')

 

The link looks like this: http://www.site.com// but it works.

Not sure what you mean when you say both secure and non-secure message. I don't get that message, but yes is the answer.

Thanks for the link to the top level index I still get the http://www.domain.com//cataloge/index.php though.

I fixed the missing log off image and now that <td> works thanks

On your last day only you will have to approve or disaprove of how your life has been.

Link to comment
Share on other sites

You fixed something because I don't get the secure/non-secure message any more.

:thumbsup:

 

I guess for the link to the "top level", just use plain old HTML.

 

I KNOW that will work!

:lol:

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 >

Link to comment
Share on other sites

I think this would work for the "top level" link:

 

   <td align="left" valign="middle"><?php echo '<a href="' . HTTP_SERVER . '">' . tep_image(DIR_WS_IMAGES . 'shield.gif', 'Home') . '</a>'; ?></td>

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 >

Link to comment
Share on other sites

Thank you everyone for your exceptional help. Here is the final version of the code that works just in case any one else would like to have a custom header.

<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr class="header">
<td align="left" valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_ROOT) . '">' . tep_image(DIR_WS_IMAGES . 'store_logo.png', HEADER_TITLE_ROOT) . '</a>'; ?></td>
<?php if (tep_session_is_registered('customer_id')){
echo '<td align="left" valign="middle">		  <a href="' . tep_href_link(FILENAME_LOGOFF, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_logoff.gif', HEADER_TITLE_LOGOFF) . '</a></td>';} ?>
<td align="left" valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', HEADER_TITLE_MY_ACCOUNT) . '</a>'; ?></td>
<td align="left" valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . tep_image(DIR_WS_IMAGES . 'header_cart.gif', HEADER_TITLE_CART_CONTENTS) . '</a>'; ?></td>
<td align="left" valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_CHECKOUT) . '</a>'; ?></td>
  </tr>
</table>

Which is put in the catalog/includes/header.php file.

In order for this to work.

  define('FILENAME_ROOT', '../');

must be added to catalog/includes/filenames.php

and

define('HEADER_TITLE_ROOT', 'Home');

must be added to catalog/includes/languages/english.php

On your last day only you will have to approve or disaprove of how your life has been.

Link to comment
Share on other sites

  • 7 months later...

i have an error on my shop:

 

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/prodet/public_html/includes/languages/romanian/products_new.php on line 16

 

here are the entire file:

 

<?php
/*
 $Id: products_new.php,v 1.3 2002/11/19 01:48:08 dgw_ Exp $

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright © 2002 osCommerce

 Released under the GNU General Public License
*/

define('NAVBAR_TITLE', 'Produse Noi');
define('HEADING_TITLE', 'Produse Noi'');

define('TEXT_DATE_ADDED', 'Data Intrarii:');
define('TEXT_MANUFACTURER', 'Producator:');
define('TEXT_PRICE', 'Pret:');
?>

 

 

can someone help me please?

Link to comment
Share on other sites

i have an error on my shop:

 

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/prodet/public_html/includes/languages/romanian/products_new.php on line 16

 

here are the entire file:

 

<?php
/*
 $Id: products_new.php,v 1.3 2002/11/19 01:48:08 dgw_ Exp $

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright © 2002 osCommerce

 Released under the GNU General Public License
*/

define('NAVBAR_TITLE', 'Produse Noi');
define('HEADING_TITLE', 'Produse Noi'');

define('TEXT_DATE_ADDED', 'Data Intrarii:');
define('TEXT_MANUFACTURER', 'Producator:');
define('TEXT_PRICE', 'Pret:');
?>

 

 

can someone help me please?

 

 

i solve the problem, it was from this line define('HEADING_TITLE', 'Produse Noi'');

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...