Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Firefox PHP works, fails in other browsers

Status
Not open for further replies.

DaRNCaT

Technical User
Dec 18, 2002
566
NZ
What could be causing a page to work properly in firefox, but to fail in all other browsers?
Could this be a URL length problem?

The page is passing info from a shopping cart, plus form data collected, to itself, if incorrect, or to the next page if correct.

It all works fine in firefox, but on all other browsers the incorrectly filled out form feild warning don't work, and then the page drops out if you submit it again.

It's all being passed using post.

HELP!

----------------------------------------
Sometimes, when my code just won't behave, I take it outside and make it listen to britney spears music, and when it comes back it's really well behaved. I wonder if it's suffering from post tramatic stress syndrome now..
 

I think you should look at asking this in the HTML forum. Once the code has left the server, it's the responsibility of the client/browser to look after things. The fact that it works with Firefox says to me that the server-side code is not specifically throwing up an error.

You can test different browsers for the maximum supported URL length... make a small test harness in PHP and try it yourself on the browsers you care about supporting. This is an easy problem to dismiss.

The "incorrectly filled out form field warning" you mentioned... is this using Javascript (I imagine so since I kn ow of no other means to validate form contents before submission)? If so... then the problem may very well be something the folks over at the Javascript forum can help with.

I would post a "view source" version of the page (specifically showing the javascript code you use for validation and the form/form fields) in the appropriate forum (not the actual PHP code).

Cheers,
Jeff
 
We found the problem, it was because Firefox will pass "submit" as a value, while other browsers won't, so we added a hidden feild name"submitted" value"1" and relabled the if isset to submitted instead of submit and checked that instead.

For anyone else who is doing a self checking page, you can't use "submit" from the form button to see if the page has been submitted, it will only work with firefox.

----------------------------------------
Sometimes, when my code just won't behave, I take it outside and make it listen to britney spears music, and when it comes back it's really well behaved. I wonder if it's suffering from post tramatic stress syndrome now..
 
if you have:

Code:
<input type="submit" name="submit" value="submit" />

you can simply check:

Code:
if ($submit == "submit") {
  // foo
  }
else {
  // bar
  }

Olav Alexander Mjelde
Admin & Webmaster
 
DaButcher
Some browsers omit the submit button when the form is submitted via field data ended with the ENTER key.

From (bad) experience:
Don't check for what the submit button actually displays. It is a value that might change during interface redesign and there is absolutley no indication that the function of the script actually depends on the value of that button. Someone will capitalize it to 'Submit' and the whole script will stop working. The change in the label for the button is probably the very last thing one thinks about in that scenario.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top