WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > IT Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

IT Discussion Forum Having IT issues? Got IT questions? Who doesn't? If you can't get your Apache to work with your MySQL or your php is choking on your ODBC... Let's see if we can help you come up with some ideas.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-05-2008, 10:04 AM
getmea getmea is offline
WebProWorld Pro
 

Join Date: Aug 2006
Location: Cary, Illinois
Posts: 153
getmea RepRank 0
Default 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:&nbsp</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\">&nbsp;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?
__________________
Skateboards and iPods...what a combination!
http://www.getmea-skateboard.com
Reply With Quote
  #2 (permalink)  
Old 03-05-2008, 11:46 AM
wige's Avatar
wige wige is offline
Moderator
WebProWorld Moderator
 

Join Date: Jun 2006
Location: United States
Posts: 1,629
wige RepRank 4wige RepRank 4wige RepRank 4
Default 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.
__________________
The best way to learn anything, is to question everything.
Interestingly Average Security Blog
Reply With Quote
  #3 (permalink)  
Old 03-06-2008, 09:29 PM
getmea getmea is offline
WebProWorld Pro
 

Join Date: Aug 2006
Location: Cary, Illinois
Posts: 153
getmea RepRank 0
Default 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!!!!!!!!!!
__________________
Skateboards and iPods...what a combination!
http://www.getmea-skateboard.com
Reply With Quote
  #4 (permalink)  
Old 03-06-2008, 10:31 PM
getmea getmea is offline
WebProWorld Pro
 

Join Date: Aug 2006
Location: Cary, Illinois
Posts: 153
getmea RepRank 0
Default 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...
__________________
Skateboards and iPods...what a combination!
http://www.getmea-skateboard.com
Reply With Quote
  #5 (permalink)  
Old 03-07-2008, 08:01 AM
DaveSawers's Avatar
DaveSawers DaveSawers is offline
WebProWorld Veteran
 

Join Date: Dec 2006
Location: Calgary, Alberta, Canada
Posts: 328
DaveSawers RepRank 1
Default 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.
__________________
Dynamic Software Development
www.activeminds.ca
Reply With Quote
  #6 (permalink)  
Old 03-07-2008, 09:37 AM
wige's Avatar
wige wige is offline
Moderator
WebProWorld Moderator
 

Join Date: Jun 2006
Location: United States
Posts: 1,629
wige RepRank 4wige RepRank 4wige RepRank 4
Default 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.
__________________
The best way to learn anything, is to question everything.
Interestingly Average Security Blog
Reply With Quote
  #7 (permalink)  
Old 03-08-2008, 07:49 AM
kgun's Avatar
kgun kgun is offline
WebProWorld 1,000+ Club
 

Join Date: May 2005
Location: Norway
Posts: 4,565
kgun RepRank 3kgun RepRank 3
Default Re: Firefox problem in php

Quote:
Originally Posted by DaveSawers View Post
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.
Reply With Quote
  #8 (permalink)  
Old 03-08-2008, 12:19 PM
getmea getmea is offline
WebProWorld Pro
 

Join Date: Aug 2006
Location: Cary, Illinois
Posts: 153
getmea RepRank 0
Default 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...
__________________
Skateboards and iPods...what a combination!
http://www.getmea-skateboard.com
Reply With Quote
  #9 (permalink)  
Old 03-08-2008, 12:49 PM
getmea getmea is offline
WebProWorld Pro
 

Join Date: Aug 2006
Location: Cary, Illinois
Posts: 153
getmea RepRank 0
Default 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
__________________
Skateboards and iPods...what a combination!
http://www.getmea-skateboard.com
Reply With Quote
  #10 (permalink)  
Old 03-08-2008, 04:40 PM
kgun's Avatar
kgun kgun is offline
WebProWorld 1,000+ Club
 

Join Date: May 2005
Location: Norway
Posts: 4,565
kgun RepRank 3kgun RepRank 3
Default 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.
Reply With Quote
  #11 (permalink)  
Old 03-09-2008, 08:54 AM
DaveSawers's Avatar
DaveSawers DaveSawers is offline
WebProWorld Veteran
 

Join Date: Dec 2006
Location: Calgary, Alberta, Canada
Posts: 328
DaveSawers RepRank 1
Default Re: Firefox problem in php

Quote:
Originally Posted by getmea View Post
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.
__________________
Dynamic Software Development
www.activeminds.ca

Last edited by DaveSawers : 03-09-2008 at 09:02 AM.
Reply With Quote
  #12 (permalink)  
Old 03-09-2008, 01:23 PM
getmea getmea is offline
WebProWorld Pro
 

Join Date: Aug 2006
Location: Cary, Illinois
Posts: 153
getmea RepRank 0
Default 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
__________________
Skateboards and iPods...what a combination!
http://www.getmea-skateboard.com
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > IT Discussion Forum
Tags: firefox, php



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
firefox css problem ozchris Accessibility and Usability Forum 11 08-18-2007 06:41 AM
Firefox hover problem ozchris Web Programming Discussion Forum 4 01-29-2006 08:44 AM
Css display problem in Firefox Spectur Graphics & Design Discussion Forum 3 11-22-2005 10:13 AM
FireFox Problem jacobwissler Graphics & Design Discussion Forum 2 05-25-2005 04:40 PM
Firefox Problem? splinter Breakroom (General: Any Topic) 12 07-18-2004 08:13 PM


Search Engine Friendly URLs by vBSEO 3.0.0