the php code is suppose to update buts not responding well
when i refresh a page its update when i click on the submit button its update plz take a look at it for me
So i guess this script works like intended. You only said what itâs currently doing, but did not say whatâs the expected behavior - so what help do you need?
What sense should this make for anybody not in common with your task?
But thereâs no difference between redirecting to an URL, and refreshing the browser tab (with POST data or not). So you have at least two options: Post/Redirect/Get or the more precise and secure approach CSFR-Token.
An HTML file (normally) isnât even an executable, so it does nothing, except for structuring some text, or showing your form, but not actuall processing it. You have to modify the PHP file, or you are looking at the wrong place.
Show all the codes related to your CSRF-token testing.
i also notice something when i enter the page at first and refresh the counter doesnt increase but when i click on the button the counter increase which is good, but wen i start to refresh aferwards the counter increasing.
Glad you got it working. Now add exit(); right after the header line to stop the execution. In many cases it wonât matter if the rest of the scripts runs but you can get into some interesting edge cases. Best to just to explicitly stop.
And take the time to turn item.php into an absolute url. Most browsers are fine with what you have but some follow the standards and produce unwanted results.
There is no âclickâ on the server side. You get requests, and you can handle them as you wish, e.g. store the requesting IP plus a counter in a database and checking against that value on every request.
Trapping it per IP address is a bit dangerous sometimes - multiple users on a shared internet connection (think of several people working in the same business) might report as the same WAN IP address when they connect to your server. So the first guy views the site, tells his friends at work, and they canât get on because youâve blocked the IP temporarily.