I've been a professional C, Perl, PHP and Python developer.
I'm an ex-sysadmin from the late 20th century.
These days I do more Javascript and CSS and whatnot, and promote UX and accessibility.
You might want to add some other $_SERVER keys there, like X_FORWARDED_FOR off the top of my head, depending on whether things are going through proxies, etc.
Also, just remembered, these values can be comma-separated lists (depending on hosting), like "123.123.123.123,101.101.101.101" so you should explode() them and loop through their values.
All good points - this is a more primitive solution as it stands, and I should probably at least mention how you can start implementing things like proxy detection.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
You might want to add some other
$_SERVER
keys there, likeX_FORWARDED_FOR
off the top of my head, depending on whether things are going through proxies, etc.Also, just remembered, these values can be comma-separated lists (depending on hosting), like
"123.123.123.123,101.101.101.101"
so you shouldexplode()
them and loop through their values.All good points - this is a more primitive solution as it stands, and I should probably at least mention how you can start implementing things like proxy detection.