Forum Moderators: coopster
eg
xx.180.206.184 #ban1
xx.26.7.10[01267] #ban2
xx.16.246. #ban3
Is there a snippet of code that I can add to the top of my php script. The code would compare the ip address of the incoming hit with the ip addresses in ban.txt
If there is a match, a message shows up "You are banned"
If there is no match, then the code below the snippet of ban code would execute.
[edited by: eelixduppy at 12:39 pm (utc) on Aug. 6, 2008]
[edit reason] obfuscated IPs [/edit]
Regarding the items in brackets xx.26.7.10[01267] that is the shorthand method in which I receive the IPs. The other scripts that use the same database recognize this shorthand.
Do you think your code would as well?
xx.26.7.10[01267] would be the same as:
xx.26.7.100
xx.26.7.101
xx.26.7.102
xx.26.7.106
xx.26.7.107
You would scrap all the user control page stuff and just put a hook in your webpages to call it.
It should give you enough of a code example that you can adapt it for your website.