blackman Posted August 2, 2016 Share Posted August 2, 2016 Hi OSCOMMERCE/PHP experts! I am searching for this error for two days now and I still cannot locate this strange behaviour. I installed the following plugin "Consolidated Login Page with Guest Checkout" and it works like a charm (at least that is what I thought). I found an error now that I just cannot track down. If someone checks out using a German Umlaut (äöüß) in one of the fields of the form he is redirected from the checkout_shipping.php to the login.php due to the customer_id is no longer registered or valid. This is the part of the code in the checkout_shipping.php that redirects him // if the customer is not logged on, redirect them to the login page if (!tep_session_is_registered('customer_id')) { $navigation->set_snapshot(); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } Without any Umlaut it is no problem at all, he is forwarded to the checkout. Apparently the whole session is destroyed, because the cart is empty afterwards, too. I just cannot find any difference between the handling of the (apparently) same form in the login.php compared to a "regular" registered user where using an Umlaut is no problem at all. It seems that some function is called that has problems with these special characters, but is only used when the guest flag is set and the guest checkout is used therefore destroying the whole session. At least that is the only thing I could imagine.... Has anyone any hint where I could search or point me in the right direction what could cause this error / or anyone installed this plugin, too and can try, if the same error happens - I'm searcing for days now, it's driving me crazy... :) Thanky you!!! Robert PHP 5.3.29 / OsCommerce 2.3.3.4 Quote Link to comment Share on other sites More sharing options...
tgely Posted August 2, 2016 Share Posted August 2, 2016 Hi @@blackmanwhat session type do you use and what is the session table charset if you use it? Quote osCommerce based shop owner with minimal design and focused on background works. When the less is more.Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store. Link to comment Share on other sites More sharing options...
blackman Posted August 2, 2016 Author Share Posted August 2, 2016 (edited) Hi, the type is 'http' and the charset used is 'utf-8' everywhere in the shop and the database - if I check out as a new customer (with an umlaut) it is no problem at all (and it is the same form according to the code, just some fields like password are missing). If I change the form from 'post' to 'get' for testing purposes: this doesn't work (first name: äTestgast): http://localhost/catalog/login.php?formid=cb1d6e3c3d1c1ee181ba37299fa50dde&action=guest&firstname=%C3%A4Testgast&lastname=testgastnachname&email_address=test%2Btestgast%40gmail.com&street_address=teststrasse&postcode=111111&city=testort&state=bayern&country=81 this does (first name Testgast): http://localhost/catalog/login.php?formid=7b9190631d1c9534e36abeca940b744a&action=guest&firstname=Testgast&lastname=testgastnachname&email_address=test%2Btestgast%40gmail.com&street_address=teststrasse&postcode=111111&city=testort&state=bayern&country=81 The '%C3%A4' is apparently causing the behaviour (an 'ä', the '%2B' not (which is a '+'). I'm confused... Edited August 2, 2016 by blackman Quote Link to comment Share on other sites More sharing options...
tgely Posted August 2, 2016 Share Posted August 2, 2016 urlencode is a good php function before render email address urlencode($email_address) after it when use as input it should reverse email address urldecode($HTTP_GET_VARS['email_address']) except superglobals ($_GET) where urldecode is working automaticaly. $HTTP_GET_VARS doesnt do this so you have to do decoding and after it you can save it into the session Quote osCommerce based shop owner with minimal design and focused on background works. When the less is more.Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.