 |

03-05-2008, 10:04 AM
|
|
WebProWorld Pro
|
|
Join Date: Aug 2006
Location: Cary, Illinois
Posts: 153
|
|
Firefox problem in php
Hi all...a customer of mine recently told me of a problem on one of my PHP pages at check out time. This secure php page allows the user to input their credit card information for processing. Elsewhere on the page, for International ordering customers, I script input text boxes for input of Bank information (name, telephone number, etc). The script is triggered by the Country entry on the prior page. On this page, the data is retrieved via a sql query.
Here is an excerpt of the script:
if ($row_cust['bcountry'] != "United States"){
echo " <tr>\n";
echo " <td valign=\"middle\" align=\"right\" height=\"5\" width=\"30%\">\n";
echo " <font class=\"white12\">*Bank Name: </font>\n";
echo " </td>\n";
echo " <td valign=\"middle\" align=\"left\" height=\"5\" width=\"70%\">\n";
echo " <input valign=\"middle\" type=\"text\" width=\"200px\" height=\"5\" name=\"ccbankname\" id=\"ccbankname\" size=\"50\" maxlength=\"50\"><font class=\"white12\"> Issued Bank</font>\n";
echo " </td>\n";
echo " </tr>\n";
...
3 more requried fields follow
...
} //end if not US
When processing a US customer using IE, it works GREAT. In Firefox, on the other hand, all 4 fields appear for US customers--BAD. I've double-checked the data saved and this "IF" statement should have resolved to FALSE. I have a Javascript routine on top which verifies data is input prior to processing the credit card.
Any ideas?
|

03-05-2008, 11:46 AM
|
 |
Moderator
|
|
Join Date: Jun 2006
Location: United States
Posts: 1,629
|
|
Re: Firefox problem in php
Add the following line, and retest in firefox to verify that the country is being passed properly:
if ($row_cust['bcountry'] != "United States"){
echo '<!-- '.$row_cust['bcountry'].' -->\n';
echo " <tr>\n";
View source, and look at the beginning of the form fields, and it will show the value of the variable. Most likely there is a difference in the way variables are passed between browsers and that is what is causing the issue.
|

03-06-2008, 09:29 PM
|
|
WebProWorld Pro
|
|
Join Date: Aug 2006
Location: Cary, Illinois
Posts: 153
|
|
Re: Firefox problem in php
Thanks for the recommendation. Unfortunately, it echoed a blank. So I echoed the entire row: the country field and (I noticed now) the State fields are blank. Not just the billing country and state but the shipping country and state fields display blank.
The curious thing is MySql (phpadmin) shows the data intact! I don't get it!!!
HELP!!!!!!!!!!
|

03-06-2008, 10:31 PM
|
|
WebProWorld Pro
|
|
Join Date: Aug 2006
Location: Cary, Illinois
Posts: 153
|
|
Re: Firefox problem in php
additional issues were found while testing in Firefox...
the CC number, expiration mm, yyyy, and civ are not posting to the next page.
I retested in Internet Explorer, no issues whatsoever...
Is there a way to test for firefox within PHP? I'm thinking for now, do not allow customers to purchase using Firefox. It's not like they're banging down my door...they amount to less than 4% of my total orders...
|

03-07-2008, 08:01 AM
|
 |
WebProWorld Veteran
|
|
Join Date: Dec 2006
Location: Calgary, Alberta, Canada
Posts: 328
|
|
Re: Firefox problem in php
This can't be a problem with PHP as such because PHP is executed server side. The browser never sees any PHP code only the resulting HTML.
So, the only possibility is with the way different browsers pass the data back to the server (as Wige said) and the way you have programmed the PHP to get the data from MySQL.
|

03-07-2008, 09:37 AM
|
 |
Moderator
|
|
Join Date: Jun 2006
Location: United States
Posts: 1,629
|
|
Re: Firefox problem in php
Do you have the form somewhere where we could test it? (if you are not comfortable posting the URL here, just send a PM)
I have a utility that lets me monitor all of the data being sent between the browser and the remote server, and this should allow me to spot any differences between IE and FF.
|

03-08-2008, 07:49 AM
|
 |
WebProWorld 1,000+ Club
|
|
Join Date: May 2005
Location: Norway
Posts: 4,565
|
|
Re: Firefox problem in php
Quote:
Originally Posted by DaveSawers
This can't be a problem with PHP as such because PHP is executed server side. The browser never sees any PHP code only the resulting HTML.
|
My obvious answer when I saw the heading.
|

03-08-2008, 12:19 PM
|
|
WebProWorld Pro
|
|
Join Date: Aug 2006
Location: Cary, Illinois
Posts: 153
|
|
Re: Firefox problem in php
Wige, all:
I've re-run a series of tests and below are the results.
Since the pages are secure, it wouuld be best to simply go to my site, add an item to the cart, and check out. Once you reach the Credit card page, you will see the bank fields show up (as originally mentioned above). These fields should only show up on non-"United States" orders.
For example, I ran two United States order transactions simultaneously. One on my laptop (IE) and one on my desktop (FF). On previous tests, they were both on the laptop, both on the desktop, vice-verse, etc. Here are the results:
1) Biiling Info page: FF: input Billing address. IE: input Billing address.
2) Shipping Info page: FF: Billing state (from mySQL) does not render to this page. Must re-input. Checked mySQL and found Billing State and Billing Country fields blank. IE, ALL good
3) CC Info page: FF: International Bank info text boxes show up for input. Thery should only show if NOT "United States". IE, text boxes do not show up (goodness). Worst yet, in FF transaction, Billing State and Country, Shipping State and Country data blank in mySQL row. In IE, ALL good.
4) Attempt to run a bogus credit card transaction...in FF, Transaction Results page show all data accepted (I will personally call the bank card to verify account address on international orders). I checked mySQL and found Billing State and Country, Shipping State and Country, CC Type (visa, MC, AMEX), Expiration date ALL MISSING.
I just noticed a pattern...THIS DATA ALL RESULTED FROM DROP DOWN LISTS.
Is this a pattern? Does FF have an interpretation issue? If it was a coding issue, wouldn't IE also have an issue?
Thnaks to ALL who can help...
|

03-08-2008, 12:49 PM
|
|
WebProWorld Pro
|
|
Join Date: Aug 2006
Location: Cary, Illinois
Posts: 153
|
|
Re: Firefox problem in php
KGun:
I am having a problem running php scripting in FF. Hence, my obvious plea for help.
The lost data is not the only issue I am having with FF. The following page when run in IE looks great. But running in FF, looks like horse doo-doo.
SEARCH | Cheap Skateboard Shop | www.Getmea-Skateboard.com
It appears I may be missing an end tag or so...this is not as much of an issue as the aforementioned missing data issue.
John
|

03-08-2008, 04:40 PM
|
 |
WebProWorld 1,000+ Club
|
|
Join Date: May 2005
Location: Norway
Posts: 4,565
|
|
Re: Firefox problem in php
May be you produce wrong markup on the server that is interpreted differently in different browsers. That is not a PHP <--> FireFox problem, but a markup / programming problem.
There is no standad on how different browser renders invalid markup / code.
Last edited by kgun : 03-08-2008 at 04:44 PM.
|

03-09-2008, 08:54 AM
|
 |
WebProWorld Veteran
|
|
Join Date: Dec 2006
Location: Calgary, Alberta, Canada
Posts: 328
|
|
Re: Firefox problem in php
Quote:
Originally Posted by getmea
I am having a problem running php scripting in FF. Hence, my obvious plea for help.
|
No you are not! The browser does not run PHP code. PHP is only executed on the server. It writes HTML and sends HTML to the browser (FF or IE or whatever) which then tries to display it.
The Firefox HTML checker detects 124 errors in the HTML on your home page. Most other pages have over 100 errors too. Maybe you should fix those first. If you have errors in your form coding that sends data back to PHP on the server, this could be causing the differences.
Last edited by DaveSawers : 03-09-2008 at 09:02 AM.
|

03-09-2008, 01:23 PM
|
|
WebProWorld Pro
|
|
Join Date: Aug 2006
Location: Cary, Illinois
Posts: 153
|
|
Re: Firefox problem in php
Dave:
Thanks for the tip! I installed the FF validator and I found the problem. I was missing an "=" sign in the <option> statements. Nothing too glaringly wrong when reviewing tons of HTML code. It was created as <option value "United States"...> instead of <option value="United States"...>. The validator also showed several other warnings which I will correct as well. I guess FF is less forgiving than IE
There are a lot of warnings related to "proprietary attributes" which FF converted to "style ..." attributes. 'll get those as well.
Thanks again!
John
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|