This is a discussion on i have an error problem with purchase without account within the osCommerce 2.2 Modification Help forums, part of the osCommerce 2.2 Forums category; when i will finish my shop at last step there is an error ...... just like it...beloW Code: Parse error: ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| when i will finish my shop at last step there is an error ...... just like it...beloW Code: Parse error: parse error, unexpected $ in c:\appserv\www\catalog\checkout_success.php on line 200 |
| Sponsored Links | ||
| ||
| |
|
#2
| |||
| |||
| i have installed purchase without account ....... this is my checkout_success.php code Code: <?php
/*
$Id: checkout_success.php,v 1.43 2002/11/23 02:29:38 thomasamoulton Exp $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2002 osCommerce
Released under the GNU General Public License
*/
require('includes/application_top.php');
if ($HTTP_GET_VARS['action'] == 'update') {
if (tep_not_null($HTTP_POST_VARS['comment']) && tep_session_is_registered('last_order')) {
$comment = tep_db_prepare_input($HTTP_POST_VARS['comment']);
if (tep_session_is_registered('customer_id')) {
tep_db_query("update " . TABLE_ORDERS . " set comments = '" . tep_db_input($comment) . "' where customers_id = '" . $customer_id . "' and orders_id = '" . $last_order . "'");
} else {
tep_db_query("update " . TABLE_ORDERS . " set comments = '" . tep_db_input($comment) . "' where customers_id = '0' and orders_id = '" . $last_order . "'");
}
tep_session_unregister('last_order');
}
$notify_string = '';
if (tep_session_is_registered('customer_id')) {
$notify_string .= 'action=notify&';
$notify = $HTTP_POST_VARS['notify'];
if (!is_array($notify)) $notify = array($notify);
$n = sizeof($notify);
for ($i=0; $i<$n; $i++) {
$notify_string .= 'notify[]=' . $notify[$i] . '&';
}
if (strlen($notify_string) > 0) $notify_string = substr($notify_string, 0, -1);
}
// Added a check for a Guest checkout and cleared the session - 030411
if (tep_session_is_registered('noaccount')) {
tep_session_destroy();
tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL'));
}
else {
tep_redirect(tep_href_link(FILENAME_DEFAULT, $notify_string, 'SSL'));
}
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_SUCCESS);
$breadcrumb->add(NAVBAR_TITLE_1);
$breadcrumb->add(NAVBAR_TITLE_2);
if (tep_session_is_registered('customer_id')) {
$global_query = tep_db_query("select global_product_notifications from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . $customer_id . "'");
$global = tep_db_fetch_array($global_query);
if ($global['global_product_notifications'] != '1') {
$orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where customers_id = '" . $customer_id . "' order by date_purchased desc limit 1");
$orders = tep_db_fetch_array($orders_query);
$products_array = array();
$products_query = tep_db_query("select products_id, products_name from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . $orders['orders_id'] . "' order by products_name");
while ($products = tep_db_fetch_array($products_query)) {
$products_array[] = array('id' => $products['products_id'],
'text' => $products['products_name']);
}
}
}
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<SCRIPT LANGUAGE="JavaScript1.2" SRC="includes/menu_animation.js"></SCRIPT>
<title><?php echo TITLE; ?></title>
<base href="<?php echo (getenv('HTTPS') == 'on' ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" oncontextmenu="window.event.returnValue=false;alert('½Đ¡È¤Å¡È½Æ¡È»s¡I')">
<!-- coolMenu //-->
<?php require(DIR_WS_INCLUDES . 'coolmenu.php'); ?>
<!-- coolMenu_eof //-->
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<!-- body //-->
<table border="0" width="780" cellspacing="3" cellpadding="3">
<tr>
<td width="<?php echo BOX_WIDTH_LEFT_IS; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH_LEFT_IS; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<td width="100%" valign="top"><form name="order" <?php echo 'action="' . tep_href_link(FILENAME_CHECKOUT_SUCCESS, 'action=update', 'SSL') . '"'; ?> method="post"><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td><table border="0" width="100%" cellspacing="4" cellpadding="2">
<tr>
<td valign="top"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_man_on_board.gif', HEADING_TITLE); ?></td>
<td valign="top" class="main"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?><div align="center" class="pageHeading"><?php echo HEADING_TITLE; ?></div><br><?php echo TEXT_SUCCESS; ?><br><br>
<?php
if (tep_session_is_registered('customer_id')) {
if ($global['global_product_notifications'] != '1') {
echo TEXT_NOTIFY_PRODUCTS . '<br><p class="productsNotifications">';
$products_displayed = array();
$n = sizeof($products_array);
for ($i=0; $i<$n; $i++) {
if (!in_array($products_array[$i]['id'], $products_displayed)) {
echo tep_draw_checkbox_field('notify[]', $products_array[$i]['id']) . ' ' . $products_array[$i]['text'] . '<br>';
$products_displayed[] = $products_array[$i]['id'];
}
}
echo '</p>';
} else {
echo TEXT_SEE_ORDERS . '<br><br>' . TEXT_CONTACT_STORE_OWNER;
}
}
?>
<h3><?php echo TEXT_THANKS_FOR_SHOPPING; ?></h3></td>
</tr>
</table></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td class="main"><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td><table border="0" width="100%" cellspacing="1" cellpadding="6" class="infoBox">
<tr class="infoBoxContents">
<td class="main"><?php echo tep_draw_textarea_field('comment', 'virtual', '60', '5'); ?></td>
</tr>
</table></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td align="right" class="main"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="50%" align="right"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>
<td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
</tr>
</table></td>
<td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
<td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
<td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
<td width="50%"><?php echo tep_image(DIR_WS_IMAGES . 'checkout_bullet.gif'); ?></td>
</tr>
</table></td>
</tr>
<tr>
<td align="center" width="25%" class="checkoutBarFrom"><?php echo CHECKOUT_BAR_DELIVERY; ?></td>
<td align="center" width="25%" class="checkoutBarFrom"><?php echo CHECKOUT_BAR_PAYMENT; ?></td>
<td align="center" width="25%" class="checkoutBarFrom"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td>
<td align="center" width="25%" class="checkoutBarCurrent"><?php echo CHECKOUT_BAR_FINISHED; ?></td>
</tr>
</table></td>
</tr>
<?php if (DOWNLOAD_ENABLED == 'true') include(DIR_WS_MODULES . 'downloads.php'); ?>
</table></form></td>
<!-- body_text_eof //-->
<td width="<?php echo BOX_WIDTH_RIGHT_IS; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH_RIGHT_IS; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
</table></td>
</tr>
</table>
<!-- body_eof //-->
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
|
|
#3
| |||
| |||
| I have exactly the same problem and have also utilised 'purchase without account' mod. Someone has suggested that i have left out a curly bracket or a white space somewhere but ive gone through the code and cant see it... the error occurs on line 166 - which is the line after the last piece of code below: <?php /* $Id: checkout_success.php,v 1.48 2003/02/17 11:51:16 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); // if the customer is not logged on, redirect them to the shopping cart page if (!tep_session_is_registered('customer_id')) { tep_redirect(tep_href_link(FILENAME_SHOPPING_CART) ); } if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'update')) { $notify_string = 'action=notify&'; $notify = $HTTP_POST_VARS['notify']; if (!is_array($notify)) $notify = array($notify); for ($i=0, $n=sizeof($notify); $i<$n; $i++) { $notify_string .= 'notify[]=' . $notify[$i] . '&'; } if (strlen($notify_string) > 0) $notify_string = substr($notify_string, 0, -1); // Added a check for a Guest checkout and cleared the session - 030411 if (tep_session_is_registered('noaccount')) { tep_session_destroy(); tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL')); } else { tep_redirect(tep_href_link(FILENAME_DEFAULT, $notify_string, 'SSL')); } require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_SUCCESS); $breadcrumb->add(NAVBAR_TITLE_1); $breadcrumb->add(NAVBAR_TITLE_2); $global_query = tep_db_query("select global_product_notifications from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . $customer_id . "'"); $global = tep_db_fetch_array($global_query); if ($global['global_product_notifications'] != '1') { $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where customers_id = '" . $customer_id . "' order by date_purchased desc limit 1"); $orders = tep_db_fetch_array($orders_query); $products_array = array(); $products_query = tep_db_query("select products_id, products_name from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . $orders['orders_id'] . "' order by products_name"); while ($products = tep_db_fetch_array($products_query)) { $products_array[] = array('id' => $products['products_id'], 'text' => $products['products_name']); } } ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> <SCRIPT LANGUAGE="JavaScript1.2" SRC="includes/menu_animation.js"></SCRIPT> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- coolMenu //--> <?php require(DIR_WS_INCLUDES . 'coolmenu.php'); ?> <!-- coolMenu_eof //--> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="3" cellpadding="3"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <td width="100%" valign="top"><?php echo tep_draw_form('order', tep_href_link(FILENAME_CHECKOUT_SUCCESS, 'action=update', 'SSL')); ?><table border="0" width="100%" cellspacing="0" background="..\wasser_bg.jpg" cellpadding="0"> <tr> <td><table border="0" width="100%" cellspacing="4" cellpadding="2"> <tr> <td valign="top"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_man_on_board.gif', HEADING_TITLE); ?></td> <td valign="top" class="main"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?><div align="center" class="pageHeading"><?php echo HEADING_TITLE; ?></div><br><?php echo TEXT_SUCCESS; ?><br><br> <?php if ($global['global_product_notifications'] != '1') { echo TEXT_NOTIFY_PRODUCTS . '<br><p class="productsNotifications">'; $products_displayed = array(); for ($i=0, $n=sizeof($products_array); $i<$n; $i++) { if (!in_array($products_array[$i]['id'], $products_displayed)) { echo tep_draw_checkbox_field('notify[]', $products_array[$i]['id']) . ' ' . $products_array[$i]['text'] . '<br>'; $products_displayed[] = $products_array[$i]['id']; } } echo '</p>'; } else { echo TEXT_SEE_ORDERS . '<br><br>' . TEXT_CONTACT_STORE_OWNER; } ?> <h3><?php echo TEXT_THANKS_FOR_SHOPPING; ?></h3></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td align="right" class="main"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="50%" align="right"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td> <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td> </tr> </table></td> <td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td> <td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td> <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td> <td width="50%"><?php echo tep_image(DIR_WS_IMAGES . 'checkout_bullet.gif'); ?></td> </tr> </table></td> </tr> <tr> <td align="center" width="25%" class="checkoutBarFrom"><?php echo CHECKOUT_BAR_DELIVERY; ?></td> <td align="center" width="25%" class="checkoutBarFrom"><?php echo CHECKOUT_BAR_PAYMENT; ?></td> <td align="center" width="25%" class="checkoutBarFrom"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td> <td align="center" width="25%" class="checkoutBarCurrent"><?php echo CHECKOUT_BAR_FINISHED; ?></td> </tr> </table></td> </tr> <?php if (DOWNLOAD_ENABLED == 'true') include(DIR_WS_MODULES . 'downloads.php'); ?> </table></form></td> <!-- body_text_eof //--> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- right_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?> <!-- right_navigation_eof //--> </table></td> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> |
|
#4
| ||||
| ||||
| bochin, the code you posted only contains 199 lines, yet your error says the problem is on line 200. If that is the case, the only thing I can see is that you have an extra blank line in your file, after line 199, and you need to delete it. Other than that, not sure what would cause this.
__________________ Michael Sasek osCMax Developer
|
|
#5
| |||
| |||
| thanks your help...but after i delete the 200 line i try it again , unfortunately it is still the same with this error below Code: Parse error: parse error, unexpected $ in c:\appserv\www\catalog\checkout_success.php on line 199 |
|
#6
| |||
| |||
| I removed line 166 - which was a blank line at the end of the file and now the error message says the error occurs on line 165...which is this line: <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> |
|
#7
| |||
| |||
| Well, i dont know whether this helps you or not bochin, but i solved the problem in my case. I use dreamweaver mx and when i first came accross the problem, i copied and pasted the original file over the version of checkout_success.php in my site folder. However, i had opened the original with dreamweaver mx. A little more digging and i came accross something that reminded me that dreamweaver has a tendancy to alter code in files, so back i goes to the original ms1 2.2 files, extract checkout_success.php - open it with notepad - then copy and paste the code into the site folder checkout_success.php file. Checked it and it works! as i say, i dont know if this will help you..but its one to consider if you are using dreamweaver. good luck |
|
#8
| |||
| |||
| it really works...... thanks for everyone ,€urorunner and msasek so enthusiastically... this is really a nice place..... thanks... |
| Sponsored Links | ||
| ||
| |
| Thread Tools | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Purchase without account | teddybear90 | osCMax v1.7 General Mods Discussion | 0 | 07-12-2005 03:25 AM |
| Purchase w/out account problem (msmax 1.7) | knullhund | osCMax v1.7 Installation | 2 | 03-23-2005 11:09 AM |
| Purchase without an account not available? | Sam_Iam | osCMax v1.7 Discussion | 3 | 12-06-2004 06:16 PM |
| purchase without account please | jloyzaga | osCMax v1.7 Discussion | 1 | 11-12-2003 05:16 AM |
| purchase without account | jloyzaga | osCMax v1.7 Discussion | 5 | 09-21-2003 08:47 AM |