PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I'm authoring and testing on a Mac using MAMP as my server and Firefox and Safari as my browsers. The following is supposed to detect that an item has been zeroed out and if so remove it from the mySQLi database. It works perfectly in Firefox, but not Safari. Suggestions? ...
Disable the cache feature in both browsers and it'll force it to get do an HTTP 200 instead of an HTTP 304. You can disable the cache in Firefox via the Web Developer Toolbar. In Safari you'll have to go in to edit menu, preferences, click on advanced, show the developer menu, then in the developer menu disable the cache.
Also you'll want to make sure you're watching your web server's access logs. Look at the HTTP code. If you're STILL getting the error and both browsers are giving code 200 instead of 304 (not modified) then you have something in your PHP that handles each browser differently.
you question is clear, the point i am trying to get at is that those codes are executed by your PHP, and it must depend on something to trigger it to delete and from your codes it looks like it will be deleted when every columns (q1,q2 etc ) is zero.
the column value of zero is not determned by either safari or firefox, that is what i am saying and is all i can see, unless there is a form where these values are updated, after which this part of the codes comes into play.
so i suspect the problem lies with the form themselves rather than here, and that is where browser differences can sometimes play tricks.
what ~php_east is getting at is PHP code is executed on the server, not on the client. The snippet you posted above is completely unrelated to the browser, because the browser never sees it, nor affects it.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Exactly why I'm wondering the difference in behaviors between browsers. If the PHP is
"executed on the server, not on the client and is completely unrelated to the browser, because the browser never sees it, nor affects it"
why don't I get the same results regardless of the browser? I understand that it's all backend, but for some reason when I call the PHP page in Safari the variables are not sent to the database, but when I execute the exact same PHP page in Firefox they are - every time - no deviation. There has to be some browser intervention or interpretation/misinterpretation somewhere along the line. I've tested multiple times, stopped and restarted my servers, cleared my cache, closed and restarted my browsers even re-booted my machine and still the information that I enter into a Safari browser window is not posting to the database whereas in Firefox it works perfectly every time.
Not trying to be difficult, and I agree with the PHP executing on server but somehow/somewhere the browser (Safari) is running interference. The data entered into the interface when using Safari is not being posted to mySQL.
sleepydad wrote:Not trying to be difficult, and I agree with the PHP executing on server but somehow/somewhere the browser (Safari) is running interference. The data entered into the interface when using Safari is not being posted to mySQL.
In that case, try looking at the HTML and any javascript of the page/form that actually does the submission to this script