chrometweaks.org

What is the best FREE forum &/or iPage web host?

Click Here To View All Answers...


Got a question, hope someone can answer... What is the best FREE forum &/or iPage web host? Hoping for any answer. Second question.. Okay, on the Order Confirmation page, I am getting the following error in the both the Delivery and Billing address areas:.

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

I have not edited the above file...any ideas what has happened and how I can fix it???.

Thank you very much!!!..

Comments (108)

I would like to know the answer too. Anyone here know what is the right answer to your question. I'll do some investigation and get back to you if I discover an useful answer. You should email the people at iPage as they probably know..

Comment #1

K, the whos_online error is fixed, but the checkout error still exists...i cant find nething on the forums relating to this.....

Thanks!..

Comment #2

Okay, problem fixed!!.

HUGE THANKS!! goto Cryp2Nite for helping me, well basically fixing it...here is a short lit of what we did:.

In your database.php file, look for this line:.

Function teb_db_query.

Add this line below that line:.

Error_log('[QUERY] '$query"n");.

Empty your error_log file....try and duplicate the error so it fills the error_log.

Run each quesry on your database to see what query is failing when passing to htmlspecialchars....

My problem was that I deleted all the countries after adding my user so it made a NULL value in my country field and was passing that to htmlspecialchars....

Hth a little bit!..

Comment #3

Ye, that was it. I too, deleted all but 1 country. I edited the user and save the new info and everything is fine..

Thanks..

Comment #4

I've got the same problem:.

I've done this but don't understand where the error_log file referred to is. I have an errors.txt file in catalog and I've tried renaming it, but I can't see any error log.I have made changes to files I don't think could have caused this problem, but reloaded my backups anyway and I still get this error..

Was working fine 1 week ago but now if I rollback one week it's broken...

Comment #5

Isn't the log path specified in admin > Configuration > Logging?.

Hth,.

Matt..

Comment #6

Thanks Matt.

Maybe I'm being particularly dim today but I still get nothing in my error_log.txt..

I've created a text file called error_log.txt in my tmp folder. I had it in the root before but was getting open_basedir errors..

The settings for logging are these:.

Store Page Parse Time  true    .

Log Destination  /tmp/error_log.txt  .

Log Date Format  %d/%m/%Y %H:%M:%S  .

Display The Page Parse Time  false  .

Store Database Queries  true.

I then go into my store and step through the checkout process until I get to checkout_confirmation.php when I get the following error above both billing address and delivery address:.

Warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/domains/wargamestore.com/user/htdocs/includes/functions/general.php on line 42.

I reopen error_log but it is still empty. I feel I am nowhere near solving this one. I've spent about 15 hours so far, banging my head against a brick wall...

Comment #7

Replacing.

Return htmlspecialchars ($string).

With.

Echo ($string).

In general.php (line 42).

Displays:.

Firstnamelastnameline1ofaddressline2ofaddresscityofcustomerpostcodeArray.

,.

In checkout_confirmation.php.

The error that started all this namely:.

Warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/domains/wargamestore.com/user/htdocs/includes/functions/general.php on line 42.

Is presumably being caused by the Array (spaces) plus the end comma. But I can't figure how I have caused this to occur. Anyone with any ideas will save my sanity. I've noticed that although the country is stored in the database and shows in the customer details in admin, it doesn't appear anywhere in the checkout. Could it be something to do with this?.

Is the $string variable in general.php failing to get the country?..

Comment #8

I had installed:.

Http://forums.oscommerce.com/index.php?showtopic=64545&hl;=.

But was unable to get it working, so I replaced the modded files with my backup versions..

I won't mention the name here but after wrestling with this for 2 days I decided to try a certain well known brand of file comparison software. I ran it against a backup from about 7 days ago. Problem solved! I don't know how it happened but there was a difference in general.php line 265 which should have been:.

Return $country_array['countries_name'];.

But which in my later file was:.

Return $country_array['my_country'];.

I've checked through the code for the above mod and can find nothing that suggests this change so I cannot figure how I came to do this, but I must have. I won't ever be without file comparison software again...

Comment #9

Solved the problem: Country ID's in the db were altered (after removing countries in the admin section) I then changed the customer's country ID on the address_book table to the proper ID that you can find in the countries table..

Comment #10

Okay, on the Order Confirmation page, I am getting the following error in the both the Delivery and Billing address areas:.

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

I have not edited the above file...any ideas what has happened and how I can fix it???.

Thank you very much!!!..

Comment #11

Also, when I tried to goto my catalog just now, I got this error:.

1016 - Can't open file: 'whos_online.MYI'. (errno: 145).

Delete from whos_online where time_last_click < '1058990023'.

[TEP STOP].

Any ideas on either of these problems???..

Comment #12


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