ShogunWarrior Posted August 21, 2006 Share Posted August 21, 2006 Hi guys, bit of a problem with Firefox, which is weird considering this is PHP.I have some code in a page like so: (pseudo)[code]Select current value from database.Put opposite of value in variable. (0 or 1)Update the database with the new value.[/code]So basically it will just reverse the 1 or 0 in the database every time I refresh the page.On Internet Explorer and Opera this works fine, I have the new/old value printed out and they reverse each time.On Firefox it stays the same, I am even printing the SQL query and it doesn't change the value in the UPDATE. How is this possible, considering all the comparison and database functions are obviously server-side.I also have the time on the page which is always current in Firefox, Opera and IE so it's not caching the whole page anyway. Quote Link to comment https://forums.phpfreaks.com/topic/18205-this-is-freaking-me-out/ Share on other sites More sharing options...
Daniel0 Posted August 21, 2006 Share Posted August 21, 2006 This is really odd, but it can't possibly be Firefox that caused the problem. Quote Link to comment https://forums.phpfreaks.com/topic/18205-this-is-freaking-me-out/#findComment-78166 Share on other sites More sharing options...
ShogunWarrior Posted August 21, 2006 Author Share Posted August 21, 2006 But BOTH IE and Opera are going fine.*** I've just logged all the queries to a file and it turns out every time I refresh the page Firefox seems to do the page twice, which will mean the value ends up being the same after reversed twice.Other browsers don't do this so I'll have to think why it would, any suggestions? Quote Link to comment https://forums.phpfreaks.com/topic/18205-this-is-freaking-me-out/#findComment-78196 Share on other sites More sharing options...
AndyB Posted August 21, 2006 Share Posted August 21, 2006 it's either a potentially lethal flaw with FireFox or something odd with your code/browsing environment. Quote Link to comment https://forums.phpfreaks.com/topic/18205-this-is-freaking-me-out/#findComment-78198 Share on other sites More sharing options...
pachelbel101 Posted August 21, 2006 Share Posted August 21, 2006 I encountered this same error in Firefox once, but instead of flipping between 0 and 1, I was incrementing a field. So each refresh incremented it by 2 instead of 1. Unfortunately I didn't track down the problem and solution, because for this application it didn't really matter. But I can back you up and say you're not crazy! Good luck. Quote Link to comment https://forums.phpfreaks.com/topic/18205-this-is-freaking-me-out/#findComment-78202 Share on other sites More sharing options...
ShogunWarrior Posted August 21, 2006 Author Share Posted August 21, 2006 I've isolated the query code to a separate page and it seems to be running OK so there is something that's going wrong somewhere on the page... don't know why it was only on Firefox.Cheers.[b]PS: Thanks pachelbel, I knew I wasn't too crazy :)[/b] Quote Link to comment https://forums.phpfreaks.com/topic/18205-this-is-freaking-me-out/#findComment-78203 Share on other sites More sharing options...
ShogunWarrior Posted August 21, 2006 Author Share Posted August 21, 2006 Just for closure if anyone is wondering what the problem was it was this:[b]<link rel="stylesheet" href="<?php echo($t_vars['css_href']); ?>" type="text/css" />[/b][b]$t_vars['css_href'][/b] was blank because I am working on the code to pull the stylesheet URL.What's interesting is IE and Opera treated the stylesheet URL as blank and didn't request it but Firefox took the blank string as meaning the current page and requested it, thereby causing two page requests.Thanks guys, SOLVED. :) Quote Link to comment https://forums.phpfreaks.com/topic/18205-this-is-freaking-me-out/#findComment-78230 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.