Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2014
    Location
    Canada
    Posts
    31
    Plugin Contributions
    0

    Default Parse error: syntax error, unexpected T_CASE in webadmin/customers.php

    I am getting this weird parase error when i click on customers/ customers.
    Parse error: syntax error, unexpected T_CASE in /home2/ubrew/public_html/webadmin/customers.php on line 341

    link 341 is:
    case 'deleteconfirm':




    END newsletter_subscribe mod 2/3
    zen_redirect(zen_href_link(FILENAME_CUSTOMERS, zen_get_all_get_params(array('cID', 'action')) . 'cID=' . $customers_id, 'NONSSL'));

    } else if ($error == true) {
    $cInfo = new objectInfo($_POST);
    $processed = true;
    }

    break;
    case 'deleteconfirm':
    // demo active test
    if (zen_admin_demo()) {
    $_GET['action']= '';
    $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
    zen_redirect(zen_href_link(FILENAME_CUSTOMERS, zen_get_all_get_params(array('cID', 'action')), 'NONSSL'));
    }
    $customers_id = zen_db_prepare_input($_POST['cID']);

    if (isset($_POST['delete_reviews']) && ($_POST['delete_reviews'] == 'on')) {
    $reviews = $db->Execute("select reviews_id
    from " . TABLE_REVIEWS . "
    where customers_id = '" . (int)$customers_id . "'");
    while (!$reviews->EOF) {
    $db->Execute("delete from " . TABLE_REVIEWS_DESCRIPTION . "
    where reviews_id = '" . (int)$reviews->fields['reviews_id'] . "'");
    $reviews->MoveNext();
    }

    $db->Execute("delete from " . TABLE_REVIEWS . "
    where customers_id = '" . (int)$customers_id . "'");
    } else {
    $db->Execute("update " . TABLE_REVIEWS . "
    set customers_id = null
    where customers_id = '" . (int)$customers_id . "'");
    }

    $db->Execute("delete from " . TABLE_ADDRESS_BOOK . "
    where customers_id = '" . (int)$customers_id . "'");

    $db->Execute("delete from " . TABLE_CUSTOMERS . "
    where customers_id = '" . (int)$customers_id . "'");

    $db->Execute("delete from " . TABLE_CUSTOMERS_INFO . "
    where customers_info_id = '" . (int)$customers_id . "'");

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Parse error: syntax error, unexpected T_CASE in webadmin/customers.php

    Use a text-comparison tool like WinMerge or P4Merge (see Useful Tools for download links) to compare your version of that file against the original ZC version. Make whatever corrections are necessary.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,478
    Plugin Contributions
    88

    Default Re: Parse error: syntax error, unexpected T_CASE in webadmin/customers.php

    I believe that a large source of your issue has to do with
    Code:
    END newsletter_subscribe mod 2/3
    That plugin has always been extremely intrusive with its changes and is not recommended for Zen Cart versions greater than v1.3.9.

  4. #4
    Join Date
    Mar 2014
    Location
    Canada
    Posts
    31
    Plugin Contributions
    0

    Default Re: Parse error: syntax error, unexpected T_CASE in webadmin/customers.php

    is there an easy way to remove it?

  5. #5
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,478
    Plugin Contributions
    88

    Default Re: Parse error: syntax error, unexpected T_CASE in webadmin/customers.php

    Not so easy, but possible. Like DrByte said a couple of posts back, use a tool like WinMerge or Beyond Compare and compare the files in the plugin's distribution (available from the Plugins download area) to your store's current file structure. If the changed files only have the plugin's changes, then it's safe to simply replace the file with the Zen Cart "base" file of the same name.

    Be sure to make both a file-system and database backup before you start!

  6. #6
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Parse error: syntax error, unexpected T_CASE in webadmin/customers.php

    Quote Originally Posted by lukaswlu View Post
    I am getting this weird parase error when i click on customers/ customers.
    Parse error: syntax error, unexpected T_CASE in /home2/ubrew/public_html/webadmin/customers.php on line 341

    link 341 is:
    case 'deleteconfirm':
    This kind of error suggests that the actual problem is in one of the lines just *before* the error line being reported.

    Quote Originally Posted by lukaswlu View Post

    END newsletter_subscribe mod 2/3
    zen_redirect(zen_href_link(FILENAME_CUSTOMERS, zen_get_all_get_params(array('cID', 'action')) . 'cID=' . $customers_id, 'NONSSL'));

    } else if ($error == true) {
    $cInfo = new objectInfo($_POST);
    $processed = true;
    }

    break;
    case 'deleteconfirm':

    Assuming this is a cut n paste, the problem is most probably caused because the line reading "END newsletter_subscribe mod 2/3" is missing the // to signify that it is a comment rather than code. If so, the fix is simple. Change this line so it reads
    // END newsletter_subscribe mod 2/3

    Cheers
    RodG

 

 

Similar Threads

  1. Parse error: syntax error, unexpected '{' in my custom php code
    By claudiapsp in forum General Questions
    Replies: 2
    Last Post: 27 Mar 2014, 03:53 PM
  2. Replies: 20
    Last Post: 21 Nov 2010, 02:48 AM
  3. Replies: 10
    Last Post: 4 Nov 2010, 09:40 PM
  4. Install: Parse error: syntax error, unexpected '/' in /includes/application_top.php
    By dlucarelli in forum Installing on a Linux/Unix Server
    Replies: 8
    Last Post: 26 Aug 2010, 02:08 PM
  5. Replies: 3
    Last Post: 13 Mar 2009, 05:20 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR