How can I restrict a computer from accessing dynamic pages of a domain name for five times in one minute. For more than five times, you can jump to the specified static page. How can I restrict a computer from accessing dynamic pages of a domain name for five times in one minute. For more than five times, you can jump to the specified static page.
Reply to discussion (solution)
What does this mean? Reduce server pressure?
What does this mean? Reduce server pressure?
An IP address is regarded as a computer. it creates an access count pool in the background and regularly clears the pool once per minute.
The IP address does not work. you can use cookies.
The IP address does not work. you can use cookies.
Find the case code...
I thought of using cookie restrictions, but I don't know how to write them properly and efficiently ..
Just use JS to operate on cookies.
5) {echo "It's max"; exit ;}$ visitCount ++; logVisitCount ($ visitCount, "too many filepath={uuid=.txt");} echo "visit count: {$ visitCount} "; function logVisitCount ($ str, $ file) {$ handle = fopen ($ file, 'w'); fwrite ($ handle, $ str ); fclose ($ handle );}
I wrote it for a moment. change it ..