atnetsolutions Posted July 23, 2003 Posted July 23, 2003 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!!!
atnetsolutions Posted July 23, 2003 Author Posted July 23, 2003 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???
atnetsolutions Posted July 23, 2003 Author Posted July 23, 2003 K, the whos_online error is fixed, but the checkout error still exists...i cant find nething on the forums relating to this.... thanks!
atnetsolutions Posted July 24, 2003 Author Posted July 24, 2003 Anyone know about the htmlspecialchars error???
atnetsolutions Posted July 24, 2003 Author Posted July 24, 2003 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!
edukes Posted July 24, 2003 Posted July 24, 2003 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
arley Posted July 24, 2003 Posted July 24, 2003 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??? How can you fized it?
Guest Posted July 30, 2003 Posted July 30, 2003 http://www.oscommerce.com/forums/viewtopic.php?t=44756
warrenthewindmill Posted December 5, 2003 Posted December 5, 2003 I've got the same problem: 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... 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 its broken.
Guest Posted December 5, 2003 Posted December 5, 2003 Isn't the log path specified in admin > Configuration > Logging? Hth, Matt
warrenthewindmill Posted December 6, 2003 Posted December 6, 2003 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.
warrenthewindmill Posted December 6, 2003 Posted December 6, 2003 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?
warrenthewindmill Posted December 7, 2003 Posted December 7, 2003 I had installed: http://www.oscommerce.com/forums/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.
Jaapv Posted November 5, 2004 Posted November 5, 2004 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 "My name is Ass, Dumb Ass"
Recommended Posts
Archived
This topic is now archived and is closed to further replies.