Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Fatal Error in Orders.PHP - CVV Coding


Shirley10

Recommended Posts

Hello Everyone,

 

I've just updated my cart to request customers to enter the CVV code on their credit card when placing an order.

 

I used the information in my host company's support guide. However, I now get a parse error message when attempting to retrieve my orders. Here is the error message.

 

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /mnt/web_g/d44/s22/b023602b/www/gbstore/nfoscomm/catalog/admin/orders.php on line 347

 

Here is the code used to update my cart.

 

<?php if (tep_not_null($order->info['cc_type']) || tep_not_null($order->info['cc_owner']) || tep_not_null($order->info['cc_number'])) { ?> <tr> </td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> </td class="main"><?php echo ENTRY_CREDIT_CARD_TYPE; ?></td> </td class="main"><?php echo $order->info['cc_type']; ?></td> </tr> <tr> </td class="main"><?php echo ENTRY_CREDIT_CARD_OWNER; ?></td> </td class="main"><?php echo $order->info['cc_owner']; ?></td> </tr> <tr> </td class="main"><?php echo ENTRY_CREDIT_CARD_NUMBER; ?></td> </td class="main"><?php echo $order->info['cc_number']; ?></td> </tr> <tr> </td class="main">CVV2: </td> </td class="main"><?php echo $order->info['cc_cvv2']; ?></td> </tr> <tr> </td class="main"><?php echo ENTRY_CREDIT_CARD_EXPIRES; ?></td> </td class="main"><?php echo $order->info['cc_expires']; ?></td> </tr> <?php } ?>

 

 

Can anyone shed light on the problem? I appreciate any help.

 

Thank you,

 

Shirley

Link to comment
Share on other sites

The first thing I see is:

Where you have </td class =...

 

This should be <td class=...

 

The </td> only appears at the end of the cell.

 

 

Try that first and then repost if you still get the error.

 

 

Hello Everyone,

 

I've just updated my cart to request customers to enter the CVV code on their credit card when placing an order.

 

I used the information in my host company's support guide. However, I now get a parse error message when attempting to retrieve my orders. Here is the error message.

 

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /mnt/web_g/d44/s22/b023602b/www/gbstore/nfoscomm/catalog/admin/orders.php on line 347

 

Here is the code used to update my cart.

 

<?php if (tep_not_null($order->info['cc_type']) || tep_not_null($order->info['cc_owner']) || tep_not_null($order->info['cc_number'])) { ?> <tr> </td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> </td class="main"><?php echo ENTRY_CREDIT_CARD_TYPE; ?></td> </td class="main"><?php echo $order->info['cc_type']; ?></td> </tr> <tr> </td class="main"><?php echo ENTRY_CREDIT_CARD_OWNER; ?></td> </td class="main"><?php echo $order->info['cc_owner']; ?></td> </tr> <tr> </td class="main"><?php echo ENTRY_CREDIT_CARD_NUMBER; ?></td> </td class="main"><?php echo $order->info['cc_number']; ?></td> </tr> <tr> </td class="main">CVV2: </td> </td class="main"><?php echo $order->info['cc_cvv2']; ?></td> </tr> <tr> </td class="main"><?php echo ENTRY_CREDIT_CARD_EXPIRES; ?></td> </td class="main"><?php echo $order->info['cc_expires']; ?></td> </tr> <?php } ?>

Can anyone shed light on the problem? I appreciate any help.

 

Thank you,

 

Shirley

Link to comment
Share on other sites

Nick,

 

Thank you so much for responding.

 

As a layperson, I cannot tell which "</td class =" you are referring to. There are multiple "</td class =" lines within the code.

 

Can you help me to identify which one should possibly be "<td class =" ?

 

For example, also include the a few identifying characters before the string, such as:

ENTRY_CREDIT_CARD_NUMBER; ?></td> </td class="main"><?

 

so that I'll know which line to edit.

 

Thanks again,

 

Shirley

 

 

The first thing I see is:

Where you have </td class =...

 

This should be <td class=...

 

The </td> only appears at the end of the cell.

Try that first and then repost if you still get the error.

Link to comment
Share on other sites

They should all be <td class=..

 

The idea is that each cell of a table is bounded by a

<td ...> content of cell </td>

 

So you also need to fix the </td colspan... that I think I saw.

 

Similarily each row of the table is bounded by <tr ...> set of cells </tr>

Link to comment
Share on other sites

Nick (and to others reading this),

 

I apologize for providing the wrong line of code. Because I entered specific coding, I thought that the problem was within that code (that would make sense). But, for some reason, the problem lies elsewhere.

 

The original information states that the problem is on line 347. Here is the coding around that line, which I've counted down from line 1.

 

 

<?php

$orders_history_query = tep_db_query("select orders_status_id, date_added, customer_notified, comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID) . "' order by date_added");

if (tep_db_num_rows($orders_history_query)) {

while ($orders_history = tep_db_fetch_array($orders_history_query)) {

echo ' <tr>' . "n" .

' <td class="smallText" align="center">' . tep_datetime_short($orders_history['date_added']) . '</td>' . "n" .

' <td class="smallText" align="center">';

if ($orders_history['customer_notified'] == '1') {

echo tep_image(DIR_WS_ICONS . 'tick.gif', ICON_TICK) . "</td>n";

} else {

echo tep_image(DIR_WS_ICONS . 'cross.gif', ICON_CROSS) . "</td>n";

}

echo ' <td class="smallText">' . $orders_status_array[$orders_history['orders_status_id']] . '</td>' . "n" .

' <td class="smallText">' . nl2br(tep_db_output($orders_history['comments'])) . ' </td>' . "n" .

' </tr>' . "n";

 

 

Line 347 is this exact line:

 

echo ' <tr>' . "n" .

 

The original error message states that the parse error is because "," or ";" is expected somewhere in line 347. According to other parse error questions on this forum, the problem does not have to be exactly line 347, which is why I've added more lines above the below.

 

Do you see where "," or ";" should appear?

 

Thank you so much. This is so perplexing.

 

Shirley

 

They should all be <td class=..

 

The idea is that each cell of a table is bounded by a

<td ...> content of cell </td>

 

So you also need to fix the </td colspan... that I think I saw.

 

Similarily each row of the table is bounded by <tr ...> set of cells </tr>

Link to comment
Share on other sites

I'm not sure what the "n" are for. Are you trying to display and 'n' on the screen?

 

As a general rule change the " with a ' on lines that are going to be displayed. Things that are within single quotes can be double qutoed.

 

The period means concatenation between 2 strings so that is ok.

 

The line:

echo ' <tr>' . "n" .

 

should be

echo '<tr>'.'n'.

or even

echo '<tr>n'.

 

Though I think the n is incorrect and could maybe be deleted(?)

 

I hope this makes sense:-)

 

If you want to post or send me the entire code, i can have quick look at it.

Link to comment
Share on other sites

Hi Nick,

 

I haven't the faintest idea what any of the code indicates. It's part of the code that creates the orders within my site.

 

I never changed this part of the code, which is why I don't know what the problem is. I changed the code where originally indicated in my first post, and that has nothing to do with this, so to me, this part of the code should be okay because I didn't touch it.

 

I'll change the quotes and see what happens. Thanks so much.

 

Shirley

 

I'm not sure what the "n" are for.  Are you trying to display and 'n' on the screen?

 

As a general rule change the " with a ' on lines that are going to be displayed.  Things that are within single quotes can be double qutoed.

 

The period means concatenation between 2 strings so that is ok.

 

The line:

echo ' <tr>' . "n" .

 

should be

echo '<tr>'.'n'.

or even

echo '<tr>n'.

 

Though I think the n is incorrect and could maybe be deleted(?)

 

I hope this makes sense:-)

 

If you want to post or send me the entire code, i can have quick look at it.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...