Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Parse Error!


Guest

Recommended Posts

Posted

Hello all,

 

In my site's backend, when I go to Customers/Orders, I get the following parse error:

 

Parse error: parse error, unexpected T_LNUMBER in /home/content/G/a/r/Garbtenement/html/shop/catalog/admin/orders.php on line 210

 

Here is the code around that line:

 

$orders_status_inputs_string .= '<br>' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_input_field('orders_status_name[' . $languages[$i]['id'] . ']');

}

 

$contents[] = array('text' => '<br>' . TEXT_INFO_ORDERS_STATUS_NAME . $orders_status_inputs_string);

$contents[] = array('text' => '<br>' . tep_draw_checkbox_field('default') . ' ' . TEXT_SET_DEFAULT);

$contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_insert.gif', IMAGE_INSERT) . ' <a href="' . tep_href_link(FILENAME_ORDERS_STATUS, 'page=' . $HTTP_GET_VARS['page']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');

break;

case 'edit':

$heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_ORDERS_STATUS . '</b>');

 

$contents = array('form' => tep_draw_form('status', FILENAME_ORDERS_STATUS, 'page=' . $HTTP_GET_VARS['page'] . '&oID=' . $oInfo->orders_status_id . '&action=save'));

$contents[] = array('text' => TEXT_INFO_EDIT_INTRO);

 

$orders_status_inputs_string = '';

$languages = tep_get_languages();

for ($i=0, $n=sizeof($languages); $i<$n; $i++) {

$orders_status_inputs_string .= '<br>' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_input_field('orders_status_name[' . $languages[$i]['id'] . ']', tep_get_orders_status_name($oInfo->orders_status_id, $languages[$i]['id']));

}

 

Does anyone know what is wrong with this code?

Posted

Psssssst....

 

Don't tell anyone....

 

But the code you posted is from /admin/order_status.php

:blush:

 

It won't be much good for finding your error since it's in another file...

:huh:

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

:blush:

 

Wow, I'm really showing my inexperience, huh?

 

Here is the code from line 200 to 220 in orders.php:

 

 

<?php

}

?>

</table></td>

</tr>

<?php include ("orders_addon_campg.php”); ?>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr class="dataTableHeadingRow">

<td class="dataTableHeadingContent" colspan="2"><?php echo TABLE_HEADING_PRODUCTS; ?></td>

<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TAX; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_EXCLUDING_TAX; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_INCLUDING_TAX; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_EXCLUDING_TAX; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_INCLUDING_TAX; ?></td>

</tr>

<?php

Posted

Try this for that one line:

 

<?php include ('orders_addon_campg.php'); ?>

(using single quotes)

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

I don't think you have the right line 210, or maybe even the right file! The error you got was from the PHP parser, so it can't be any line in plain HTML (as your line 210 <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> is). I don't think that changing " to ' in line 205 (per germ) is going to have any effect -- there are no variables or control codes embedded in that string. I can't see anything wrong in the little PHP code that's in those lines.

 

It's possible that one or more of the "defines" used after line 210 are undefined, e.g., TABLE_HEADING_PRODUCTS. Somewhere in an included file you should find define ('TABLE_HEADING_PRODUCTS', 'Table of Products'); or something similar in each case. Make sure those macro definitions are available, or you'll end up with echo ; which is an error.

 

If none of that helps, either you're still in the wrong file, or you miscounted the source code lines. Use an editor that tells you what line you're on, rather than counting by hand. And confirm that file 'orders_addon_campg.php' exists and is in the same directory as orders.php and doesn't have any errors within it.

Posted

If you copy/paste his code into a good text editor you'll see the (a?) 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

You were right germ, it was the double quotes. Working perfectly now! Thanks for the help gents.

 

The text editor I used to find the line is ConTEXT. Is there a better freeware one out there, or should I just pay for one if I want something half decent for a newbie?

Posted

Personally I use (and am very fond of) Crimson Editor.

 

It's freeware - just type it into your favorite search engine.

:)

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

Ah, I see it now.

<?php include ("orders_addon_campg.php”); ?>

The second (closing) quote was an idiot Microsoft Smart Quote, right? Never, EVER use MS word processors to edit source code. BTW, you could have changed it to the same quote as the opening ", and didn't have to change both to '.

 

Very difficult to spot in a posting, but in the post editor it sticks out like a sore thumb.

Posted

I've seen people use "the other apostrophe" (the one in the upper left of the keyboard on the tilde key).

 

That's a bear to spot, too.

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...