chrometweaks.org

Are we going to see some racy Mark Martin-iPage ads?

Click Here To View All Answers...


Got a question... Are we going to see some racy Mark Martin-iPage ads? Looking forward for any answer or 2. Second question of mine... Warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/efabien/public_html/fabien/includes/functions/general.php on line 42.

Warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/efabien/public_html/fabien/includes/functions/general.php on line 42.

Any idea ???.

Thanks..

Comments (123)

Yes sir! but you might want to make sure and wait for another person here to confirm it as I am not very confident. Better yet, why don't you email the iPage guys because they can answer you better...

Comment #1

Hi and thanks for answering..

It started when I added Zone Charge and I did create a new account, still the same ... did creating a new accounts solve your issue?..

Comment #2

Interesting fact:.

This only happens when I select "zone rates", if I select "flat rate", then Billing seems fine ... any idea?..

Comment #3

I'm getting this error on MS2 after putting in the shipincart mod and I'm using zones too ....

It only appears when the customer is logged in (not logged in = no problem at all) and the error message appears where the customer's address should display in the shipincart info box on the cart contents page. And I haven't changed general.php at all ... hmmm ...that function seems to check html output for illegal tags, so where is the 'non-string' being generated I wonder .....

Comment #4

It is being called by tep_address_format. It means that the shipping or billing address is not being passed properly for some reason. Or at least not all of it..

Hth,.

Matt..

Comment #5

Ahhh ... could that be something to do with moving the postcode down below the country (where it should be, of course... at least in the UK ).

And (maybe...) not getting it in the right place...?.

Did that a while ago but haven't noticed any problems ... only started to get the error after I put shipincart in, and then not every time I go to cart contents page ... which is odd too....

Hmmm .... will go and take a look at that..

Thanks for your help...

Comment #6

Ah-ha! ... just put a bit of code into general.php to print the $string that's being returned and what htmlspecialchars() doesn't like is:.

Array ( [id] => [title] => [iso_code_2] => [iso_code_3] => ).

And I guess that's because it's an array rather than a string (as it says) ... but that bit of code isn't in any of the OSC files ... so how can I track it down in it's coded form...?..

Comment #7

Found it ....

I restored from backup and went through the changes I'd made again..

The array that was causing the problem in my case was being built up here (in shipping_estimator.php):.

$order->delivery = array('postcode' => $HTTP_POST_VARS['zip_code'],.

                                'country' => array('id' => $HTTP_POST_VARS['country_id'], 'title' => $country_info['countries_name'], 'iso_code_2' => $country_info['countries_iso_code_2'], 'iso_code_3' =>  $country_info['countries_iso_code_3']),.

But the postcode wasn't making it because I'd moved it down to display below the state in create_account.php, includes/modules/address_book_details.php, and includes/modules/checkout_new_address.php and one of the moved bits of code was in the wrong place. Although the error had been there for weeks (since I made that postcode code change) it only appeared when I logged in and added a new address in address book to test the shipping estimator contribution I'd just added..

(In case it helps anyone else, the address array is also built up in several other files - do a search on' iso_code' to find them.).

Thanks for your help - it put me on the right track...

Comment #8

OK, I get that there is a problem with shipping mod. I added a mod for setting individual shipping prices, instead of shipping weight. Now I am getting the same problems mentioned above..

I'm fairly new at this php stuff, so I may have missed it. How do I fix this bug?..

Comment #9

It's not so much that there is a problem with a/any shipping mod, more that you can get the 'htmlspecialchars' error when you make changes to the code (often, of course, as the result of adding a mod) and do something that prevents the address array from being built up properly..

It's a tricky one to track down, may be quicker to do what I did and restore from backup then add the mod/make the changes again...?..

Comment #10

I just changed my country code (actually added my country code) and all seems to be well. At least as far as the first error goes. The problem now is that after clicking the last "confirm order" button I get a new message..

1054 - Unknown column 'orders_status_id' in 'field list'.

Insert into orders_status_history (orders_id, orders_status_id, date_added, customer_notified, comments) values ('15', '1', now(), '1', '').

[TEP STOP].

Any idea on why this error is here?..

Comment #11

It's difficult to suggest anything without more info on which file the error is happening in ... what is the file that's giving the error? i.e. where is 'field list' coming from (- look at the address bar in your browser)?.

What version of OSC are you using?.

What mods have you added recently and what files have you made changes to?.

Orders_status_id exists in my database (MS2) - does it exist in yours?.

Hth..

Comment #12

The address line reads.

The following info is found at the beginning of the checkout_process.php code.

/*.

 $Id: checkout_process.php,v 1.128 2003/05/28 18:00:29 hpdl Exp $.

 osCommerce, Open Source E-Commerce Solutions.

 http://www.oscommerce.com.

 Copyright (c) 2003 osCommerce.

 Released under the GNU General Public License.

*/.

I download 2.2ms2 and added several mods....

Attributes copier.

Product rate (shipping mod).

And possibly a couple others, these, however are the main ones..

Orders_status_id does exist in my database..

Again thanks for any help you can give me!..

Comment #13

Help - Shipping probs too. When I add the united parcel service as a shipping method, I get page cannot be displayed when customer trys to checkout. Also, how do you get a FedEx option to display?..

Comment #14

I may have found a problem with my database. When I looked into the orders_status_id I found two listings..

Is this right? Or do I need to change something?..

Comment #15

I think you're looking at the wrong table there ... you need to look at orders_status_history - that table is 'orders_status' (both tables have 'orders_status_id' fields)..

The bit of code in checkout_process.php that creates that SQL insert seems pretty simple:.

$sql_data_array = array('orders_id' => $insert_id,.

                         'orders_status_id' => $order->info['order_status'],.

                         'date_added' => 'now()',.

                         'customer_notified' => $customer_notification,.

                         'comments' => $order->info['comments']);.

 tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);.

It unusual for the database to be a cause unless you've accidentally deleted/changed something. The error you have is saying the field orders_status_id doesn't exist in the table orders_status_history ... does it?..

Comment #16

No, I get the error listed here. I couple other threads spoke of this error occuring when you upgrade to ms2. I believe when I set up the original db it was under ms1. Thanks for any help you can give..

Comment #17

Sorry, actually, yes it does say orders_status_history.

Can someone who isn't having this problem show me a screenshot of that db table?..

Comment #18

I think that I got it figured out. For some reason the table called orders_status_history was missing several vital rows. You need to add the orders_status_id row and whatever other errors you may get (eg I had a similar error pop up next due to the lack of a comments row). Here is a screenshot of my completed table. I believe this error comes from the update to ms2 from ms1..

Hope this helps others who had this problem.....

Comment #19

Dee (if you're still watching this thread) and anyone else that can help,.

I'm having a similar problem to the one Dee detailed at the start of this thread..

I've just installed the shipping in cart contribution and, like you I sometimes get the htmlspecialchars error where the shipping address should be..

It's only occurring occasionally. It seems like the first person to log in using an instance of the browser gets to see their address OK. If you then log out and log in as a different user the error appears. If you log out and re-login as the original user the address it there OK, with no error..

If you open a new browser window the error isn't there for the first user to login, but comes back for the second. How can this be explained? Is it to do with cacheing or some browser settings?.

I have also changed the code in create_account.php and other files to put the post code after the county, to display United Kingdom as the only country and to add Uk counties in a drop down list..

Can you just explain what exactly you did to fix the errors. Did you have to change some of your modifications to create_account.php and the other address files, or did you have to change the format of the "$order->delivery = array" lines? If so, what changes did you make..

Thanks in advance for your help.

Tim..

Comment #20

For me it was moving the postcode down that caused the htmlspecialchars error ... I just had it in the wrong place. I don't know if it will help, but this is the relevant bit of my create_account.php:.

   if ($error == false) {.

     $sql_data_array = array('customers_firstname' => $firstname,.

                             'customers_lastname' => $lastname,.

                             'customers_email_address' => $email_address,.

                             'customers_telephone' => $telephone,.

                             'customers_fax' => $fax,.

                             'customers_newsletter' => $newsletter,.

                             'customers_password' => tep_encrypt_password($password));.

     if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender;.

     if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = tep_date_raw($dob);.

     tep_db_perform(TABLE_CUSTOMERS, $sql_data_array);.

     $customer_id = tep_db_insert_id();.

     $sql_data_array = array('customers_id' => $customer_id,.

                             'entry_firstname' => $firstname,.

                             'entry_lastname' => $lastname,.

                             'entry_street_address' => $street_address,.

                             'entry_postcode' => $postcode,.

                             'entry_city' => $city,.

                             'entry_country_id' => $country);.

     if (ACCOUNT_GENDER == 'true') $sql_data_array['entry_gender'] = $gender;.

     if (ACCOUNT_COMPANY == 'true') $sql_data_array['entry_company'] = $company;.

     if (ACCOUNT_SUBURB == 'true') $sql_data_array['entry_suburb'] = $suburb;.

     if (ACCOUNT_STATE == 'true') {.

       if ($zone_id > 0) {.

         $sql_data_array['entry_zone_id'] = $zone_id;.

         $sql_data_array['entry_state'] = '';.

       } else {.

         $sql_data_array['entry_zone_id'] = '0';.

         $sql_data_array['entry_state'] = $state;.

       }.

     }.

     tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);.

     $address_id = tep_db_insert_id();.

     tep_db_query("update "TABLE_CUSTOMERS" set customers_default_address_id = '"(int)$address_id"' where customers_id = '"(int)$customer_id"'");.

     tep_db_query("insert into "TABLE_CUSTOMERS_INFO" (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('"(int)$customer_id"', '0', now())");.

     if (SESSION_RECREATE == 'True') {.

       tep_session_recreate();.

     }.

     $customer_first_name = $firstname;.

     $customer_default_address_id = $address_id;.

     $customer_country_id = $country;.

     $customer_zone_id = $zone_id;.

     tep_session_register('customer_id');.

     tep_session_register('customer_first_name');.

     tep_session_register('customer_default_address_id');.

     tep_session_register('customer_country_id');.

     tep_session_register('customer_zone_id');.

// restore cart contents.

     $cart->restore_contents();.

// build the message content.

     $name = $firstname' '$lastname;.

     if (ACCOUNT_GENDER == 'true') {.

        if ($gender == 'm') {.

          $email_text = sprintf(EMAIL_GREET_MR, $lastname);.

        } else {.

          $email_text = sprintf(EMAIL_GREET_MS, $lastname);.

        }.

     } else {.

       $email_text = sprintf(EMAIL_GREET_NONE, $firstname);.

     }.

     $email_text .= EMAIL_WELCOMEEMAIL_TEXTEMAIL_CONTACTEMAIL_WARNING;.

     tep_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);.

     tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL'));.

   }.

 }.

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));.

?>.

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

<?php require('includes/form_check.js.php'); ?>.

<! BOF Added Must Agree to Privacy //>.

<script language="javascript"><!.

Function rowOverEffect(object) {.

 document.create_account.elements[object].parentNode.parentNode.className = 'moduleRowOver';.

}.

Function rowOutEffect(object) {.

 if (document.create_account.elements[object].checked) {.

   document.create_account.elements[object].parentNode.parentNode.className = 'moduleRowSelected';.

 } else {.

   document.create_account.elements[object].parentNode.parentNode.className = 'moduleRow';.

 }.

}.

Function checkboxRowEffect(object) {.

 document.create_account.elements[object].checked = !document.create_account.elements[object].checked;.

 if(document.create_account.elements[object].checked) {.

   document.create_account.elements[object].parentNode.parentNode.className = 'moduleRowSelected';.

 } else {.

   document.create_account.elements[object].parentNode.parentNode.className = 'moduleRowOver';.

 }.

}.

Function check_form_wrapper(formname) {.

 if (check_form(formname)) {.

   if (formname.elements['agree'].checked) {.

     return true;.

   } else {.

     alert('<?php echo ENTRY_PRIVACY_AGREEMENT_ERROR; ?>');.

     submitted = false;.

     return false;.

   }.

 } else {.

   formname.elements['agree'].checked = false;.

   return false;.

 }.

}.

//></script>.

<! EOF Added Must Agree to Privacy //>.

</head>.

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">.

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

  <!REMOVED ORIGINAL CODE <td width="100%" valign="top"><?php echo tep_draw_form('create_account', tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'), 'post', 'onSubmit="return check_form(create_account);"')tep_draw_hidden_field('action', 'process'); ?><table border="0" width="100%" cellspacing="0" cellpadding="0"> //>.

    <! BOF Added Must Agree to Privacy //>.

     .

         <td width="100%" valign="top"><?php echo tep_draw_form('create_account', tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'), 'post', 'onSubmit="return check_form_wrapper(create_account);"')tep_draw_hidden_field('action', 'process'); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">.

     <! EOF Added Must Agree to Privacy //>.

     <tr>.

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

         <tr>.

           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>.

           <!<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES'table_background_account.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> //>.

         </tr>.

       </table></td>.

     </tr>.

     <tr>.

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

     </tr>.

     <tr>.

       <td class="smallText"><br><?php echo sprintf(TEXT_ORIGIN_LOGIN, tep_href_link(FILENAME_LOGIN, tep_get_all_get_params(), 'SSL')); ?></td>.

     </tr>.

     <tr>.

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

     </tr>.

<?php.

 if ($messageStack->size('create_account') > 0) {.

?>.

     <tr>.

       <td><?php echo $messageStack->output('create_account'); ?></td>.

     </tr>.

     <tr>.

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

     </tr>.

<?php.

 }.

?>.

     <tr>.

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

         <tr>.

           <td class="main"><b><?php echo CATEGORY_PERSONAL; ?></b></td>.

          <td class="inputRequirement" align="right"><?php echo FORM_REQUIRED_INFORMATION; ?></td>.

         </tr>.

       </table></td>.

     </tr>.

     <tr>.

       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">.

         <tr class="infoBoxContents">.

           <td><table border="0" cellspacing="2" cellpadding="2">.

<?php.

 if (ACCOUNT_GENDER == 'true') {.

?>.

             <tr>.

               <td class="main"><?php echo ENTRY_GENDER; ?></td>.

               <td class="main"><?php echo tep_draw_radio_field('gender', 'm')'&nbsp;&nbsp;'MALE'&nbsp;&nbsp;'tep_draw_radio_field('gender', 'f')'&nbsp;&nbsp;'FEMALE'&nbsp;'(tep_not_null(ENTRY_GENDER_TEXT) ? '<span class="inputRequirement">'ENTRY_GENDER_TEXT'</span>': ''); ?></td>.

             </tr>.

<?php.

 }.

?>.

             <tr>.

               <td class="main"><?php echo ENTRY_FIRST_NAME; ?></td>.

               <td class="main"><?php echo tep_draw_input_field('firstname')'&nbsp;'(tep_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="inputRequirement">'ENTRY_FIRST_NAME_TEXT'</span>': ''); ?></td>.

             </tr>.

             <tr>.

               <td class="main"><?php echo ENTRY_LAST_NAME; ?></td>.

               <td class="main"><?php echo tep_draw_input_field('lastname')'&nbsp;'(tep_not_null(ENTRY_LAST_NAME_TEXT) ? '<span class="inputRequirement">'ENTRY_LAST_NAME_TEXT'</span>': ''); ?></td>.

             </tr>.

<?php.

 if (ACCOUNT_DOB == 'true') {.

?>.

             <tr>.

               <td class="main"><?php echo ENTRY_DATE_OF_BIRTH; ?></td>.

               <td class="main"><?php echo tep_draw_input_field('dob')'&nbsp;'(tep_not_null(ENTRY_DATE_OF_BIRTH_TEXT) ? '<span class="inputRequirement">'ENTRY_DATE_OF_BIRTH_TEXT'</span>': ''); ?></td>.

             </tr>.

<?php.

 }.

?>.

             <tr>.

               <td class="main"><?php echo ENTRY_EMAIL_ADDRESS; ?></td>.

               <td class="main"><?php echo tep_draw_input_field('email_address')'&nbsp;'(tep_not_null(ENTRY_EMAIL_ADDRESS_TEXT) ? '<span class="inputRequirement">'ENTRY_EMAIL_ADDRESS_TEXT' (Will only be used in connection with your order)''</span>': ''); ?></td>.

             </tr>.

           </table></td>.

         </tr>.

       </table></td>.

     </tr>.

<?php.

 if (ACCOUNT_COMPANY == 'true') {.

?>.

     <tr>.

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

     </tr>.

     <tr>.

       <td class="main"><b><?php echo CATEGORY_COMPANY; ?></b></td>.

     </tr>.

     <tr>.

       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">.

         <tr class="infoBoxContents">.

           <td><table border="0" cellspacing="2" cellpadding="2">.

             <tr>.

               <td class="main"><?php echo ENTRY_COMPANY; ?></td>.

               <td class="main"><?php echo tep_draw_input_field('company')'&nbsp;'(tep_not_null(ENTRY_COMPANY_TEXT) ? '<span class="inputRequirement">'ENTRY_COMPANY_TEXT'</span>': ''); ?></td>.

             </tr>.

           </table></td>.

         </tr>.

       </table></td>.

     </tr>.

<?php.

 }.

?>.

     <tr>.

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

     </tr>.

     <tr>.

       <td class="main"><b><?php echo CATEGORY_ADDRESS; ?></b></td>.

     </tr>.

     <tr>.

       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">.

         <tr class="infoBoxContents">.

           <td><table border="0" cellspacing="2" cellpadding="2">.

             <tr>.

               <td class="main"><?php echo ENTRY_STREET_ADDRESS; ?></td>.

               <td class="main"><?php echo tep_draw_input_field('street_address')'&nbsp;'(tep_not_null(ENTRY_STREET_ADDRESS_TEXT) ? '<span class="inputRequirement">'ENTRY_STREET_ADDRESS_TEXT'</span>': ''); ?></td>.

             </tr>.

<?php.

 if (ACCOUNT_SUBURB == 'true') {.

?>.

             <tr>.

               <td class="main"><?php echo ENTRY_SUBURB; ?></td>.

               <td class="main"><?php echo tep_draw_input_field('suburb')'&nbsp;'(tep_not_null(ENTRY_SUBURB_TEXT) ? '<span class="inputRequirement">'ENTRY_SUBURB_TEXT'</span>': ''); ?></td>.

             </tr>.

<?php.

 }.

?>.

             .

             <tr>.

               <td class="main"><?php echo ENTRY_CITY; ?></td>.

               <td class="main"><?php echo tep_draw_input_field('city')'&nbsp;'(tep_not_null(ENTRY_CITY_TEXT) ? '<span class="inputRequirement">'ENTRY_CITY_TEXT'</span>': ''); ?></td>.

             </tr>.

<?php.

 if (ACCOUNT_STATE == 'true') {.

?>.

             <tr>.

               <td class="main"><?php echo ENTRY_STATE; ?></td>.

               <td class="main">.

<?php.

   if ($process == true) {.

     if ($entry_state_has_zones == true) {.

       $zones_array = array();.

       $zones_query = tep_db_query("select zone_name from "TABLE_ZONES" where zone_country_id = '"(int)$country"' order by zone_name");.

       while ($zones_values = tep_db_fetch_array($zones_query)) {.

         $zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);.

       }.

       echo tep_draw_pull_down_menu('state', $zones_array);.

     } else {.

       echo tep_draw_input_field('state');.

     }.

   } else {.

     echo tep_draw_input_field('state');.

   }.

   if (tep_not_null(ENTRY_STATE_TEXT)) echo '&nbsp;<span class="inputRequirement">'ENTRY_STATE_TEXT;.

?>.

               </td>.

             </tr>.

             <tr>.

               <td class="main"><?php echo ENTRY_POST_CODE; ?></td>.

               <td class="main"><?php echo tep_draw_input_field('postcode')'&nbsp;'(tep_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="inputRequirement">'ENTRY_POST_CODE_TEXT'</span>': ''); ?></td>.

             </tr>.

<?php.

 }.

?>.

             <tr>.

               <td class="main"><?php echo ENTRY_POST_CODE; ?></td>.

               <td class="main"><?php echo tep_draw_input_field('postcode')'&nbsp;'(tep_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="inputRequirement">'ENTRY_POST_CODE_TEXT'</span>': ''); ?></td>.

             </tr>.

             <tr>.

               <td class="main"><?php echo ENTRY_COUNTRY; ?></td>.

               <td class="main"><?php echo tep_get_country_list('country')'&nbsp;'(tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">'ENTRY_COUNTRY_TEXT'</span>': ''); ?></td>.

             </tr>.

           </table></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 CATEGORY_CONTACT; ?></b></td>.

     </tr>.

     <tr>.

       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">.

         <tr class="infoBoxContents">.

           <td><table border="0" cellspacing="2" cellpadding="2">.

             <tr>.

               <td class="main"><?php echo ENTRY_TELEPHONE_NUMBER; ?></td>.

               <td class="main"><?php echo tep_draw_input_field('telephone')'&nbsp;'(tep_not_null(ENTRY_TELEPHONE_NUMBER_TEXT) ? '<span class="inputRequirement">'ENTRY_TELEPHONE_NUMBER_TEXT' (Will only be used in case of queries with your order)' .'</span>': ''); ?></td>.

             </tr>.

             <tr>.

               <td class="main"><?php echo ENTRY_FAX_NUMBER; ?></td>.

               <td class="main"><?php echo tep_draw_input_field('fax')'&nbsp;'(tep_not_null(ENTRY_FAX_NUMBER_TEXT) ? '<span class="inputRequirement">'ENTRY_FAX_NUMBER_TEXT'</span>': ''); ?></td>.

             </tr>.

           </table></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 CATEGORY_OPTIONS; ?></b></td>.

Notice that I also changed the array code around near the top ... don't know if that makes a difference, but it seemed a-good-thing-to-do.

(Don't forget to delete the privacy mod code if you want to do a diff....).

Hth..

Comment #21

Why have you got the POST CODE entry box in twice, once inside the an.

If (tep_not_null(ENTRY_STATE_TEXT)) statement and once outside it?.

  if (tep_not_null(ENTRY_STATE_TEXT)) echo '&nbsp;<span class="inputRequirement">'ENTRY_STATE_TEXT;.

?>.

              </td>.

            </tr>.

            <tr>.

              <td class="main"><?php echo ENTRY_POST_CODE; ?></td>.

              <td class="main"><?php echo tep_draw_input_field('postcode')'&nbsp;'(tep_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="inputRequirement">'ENTRY_POST_CODE_TEXT'</span>': ''); ?></td>.

            </tr>.

<?php.

}.

?>.

            <tr>.

              <td class="main"><?php echo ENTRY_POST_CODE; ?></td>.

              <td class="main"><?php echo tep_draw_input_field('postcode')'&nbsp;'(tep_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="inputRequirement">'ENTRY_POST_CODE_TEXT'</span>': ''); ?></td>.

            </tr>.

I have my ENTRY_POST_CODE outside the if statement..

   if (tep_not_null(ENTRY_STATE_TEXT)) echo '&nbsp;<span class="inputRequirement">'ENTRY_STATE_TEXT;.

?>.

               </td>.

             </tr>.

<?php.

 }.

?>.

             <tr>.

               <td class="main"><?php echo ENTRY_POST_CODE; ?></td>.

               <td class="main"><?php echo tep_draw_input_field('postcode')'&nbsp;'(tep_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="inputRequirement">'ENTRY_POST_CODE_TEXT'</span>': ''); ?></td>.

             </tr>.

I've made a few more changes around there so there are lots of differences..

How does the address get made up by the shipping_estimator.php file? It seems very strange that it works OK for the first person using a browser but after logout and another login it fails fort he second person..

Thanks for your help..

Tim..

Comment #22

Hi Tim,.

Sorry for the belated reply - I didn't get an email from the forum telling me you had posted..

I think the postcode bit within the 'If ...' statement is for when 'Require State' is turned on in admin ... I don't use that, and it's probably a red herring (because, being in the UK you probably don't use 'State' either and so that bit of code wouldn't be invoked)..

Although the error refers to line 42-ish in general.php that's only because the function htmlspecialchars() lives there ... the error is because that function is called to check the address array for special ('illegal') characters and finds some. The address array seems to be built up in several files - wherever address arrays are needed, I guess. To find which files, do a search on all the files in your 'Catalog' folder for the string: iso_code (or any other string from that array - see my previous posts in this thread)..

In my case the error was coming from either create_account.php, includes/modules/address_book_details.php, or includes/modules/checkout_new_address.php..

Because I'd messed up the code while I was trying to move the postcode down in those files, so I made copies of those three (existing) files for safety and then replaced them with brand new files from a stock MS2 download and did the postcode move again, and everything worked fine..

I agree it's a weird error that sometimes shows and sometimes doesn't - I had that behaviour too. But after several hours trying to track it down I realised it would be quicker to start with new files..

Hth..

Comment #23

Warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/efabien/public_html/fabien/includes/functions/general.php on line 42.

Warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/efabien/public_html/fabien/includes/functions/general.php on line 42.

Any idea ???.

Thanks..

Comment #24

I had this problem after I deleted all the countries and changed the default country's ID..

Just for kicks. try creating a new account in your store, and see if it gives you the same error...

Comment #25


This question was taken from a support group/message board and re-posted here so others can learn from it.