Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

Parse error


  • You cannot reply to this topic
7 replies to this topic

#1 chycco

  • Community Member
  • 48 posts
  • Real Name:Luca Grani

Posted 25 July 2003, 16:29

Hi

When I try to see my orders, suddendly I have this error:

Parse error: parse error in /home/italiang/public_html/omysite/admin/orders.php on line 68

where line 68 is:

case 'deleteconfirm':


Anybody could tell me what's on earth is going on? :)
thanx in advance

chycco

#2 Rumble

  • Community Member
  • 631 posts
  • Real Name:A Reddy

Posted 25 July 2003, 16:42

Hi,

Its not always the exact line thats the problem. Make sure the rmaining lines after that looks like;

    case 'deleteconfirm':

      $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);



      tep_remove_order($oID, $HTTP_POST_VARS['restock']);



      tep_redirect(tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action'))));

      break;

  }

good luck
Reddy to Rumble

Thank you osCommerce and all who Contribute to her!

#3 chycco

  • Community Member
  • 48 posts
  • Real Name:Luca Grani

Posted 25 July 2003, 17:35

mmm....it's the same code I have :cry:

help.........

#4 lloydrobbins

  • Community Member
  • 25 posts
  • Real Name:Lloyd Robbins

Posted 25 July 2003, 18:08

Check the lines immediatly preceeding it. Extract the original version from the zip file your downloaded (You did keep it, didn't you? :D ) and compare the two files. Examdiff works well for this.

http://www.prestosoft.com/ps.asp?page=edp_examdiff

You've changed the code somehow, and now the PHP preprocessor can't work with it.
--
Lloyd

"Managing programmers is like herding cats."

#5 chycco

  • Community Member
  • 48 posts
  • Real Name:Luca Grani

Posted 25 July 2003, 18:31

yess....
i have change the file with the original orders.phpand now it works.

I had modify some lines to have the number order in the subject line of the customer (and admin) email.... but i don't understand...it worked...and suddendly it didn't work...

really thanx to you

#6 lloydrobbins

  • Community Member
  • 25 posts
  • Real Name:Lloyd Robbins

Posted 25 July 2003, 18:39

You're welcome.

I've found that parse errors are usually a result of either leaving off a semi-colon or missing a bracket.
Here's the code from my admin orders.php. I get emails with the subject of "Hitches-Online.Com Order #1234". Is that what you are looking for?


case 'update_order':

      $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);

      $status = tep_db_prepare_input($HTTP_POST_VARS['status']);

      $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);



      $order_updated = false;

      $check_status_query = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . tep_db_input($oID) . "'");

      $check_status = tep_db_fetch_array($check_status_query);

      if ($check_status['orders_status'] != $status || $comments != '') {

        tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . tep_db_input($status) . "', last_modified = now() where orders_id = '" . tep_db_input($oID) . "'");



        $customer_notified = '0';

        if ($HTTP_POST_VARS['notify'] == 'on') {

          $notify_comments = '';

          if ($HTTP_POST_VARS['notify_comments'] == 'on') {

            $notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $comments) . "nn";

          }

          $email = STORE_NAME . "n" . EMAIL_SEPARATOR . "n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "nn" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);

          tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, nl2br($email), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

          $customer_notified = '1';

        }



        tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . tep_db_input($oID) . "', '" . tep_db_input($status) . "', now(), '" . $customer_notified . "', '" . tep_db_input($comments)  . "')");



        $order_updated = true;

      }



      if ($order_updated) {

       $messageStack->add_session(SUCCESS_ORDER_UPDATED, 'success');

      } else {

        $messageStack->add_session(WARNING_ORDER_NOT_UPDATED, 'warning');

      }



      tep_redirect(tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action')) . 'action=edit'));

      break;

    case 'deleteconfirm':

    

--
Lloyd

"Managing programmers is like herding cats."

#7 chycco

  • Community Member
  • 48 posts
  • Real Name:Luca Grani

Posted 25 July 2003, 21:52

yeah!!
I have changed these line and now i have my target!!!
thank you very much! It works perfectly as i want! :)

#8 lloydrobbins

  • Community Member
  • 25 posts
  • Real Name:Lloyd Robbins

Posted 25 July 2003, 23:49

Glad I could help!

Stop by our store if you need a hitch or auto accessories :D

www.hitches-online.com
--
Lloyd

"Managing programmers is like herding cats."