<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Php on René Moser</title><link>https://www.renemoser.net/tags/php/</link><description>Recent content in Php on René Moser</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Tue, 23 Dec 2008 00:00:00 +0000</lastBuildDate><atom:link href="https://www.renemoser.net/tags/php/index.xml" rel="self" type="application/rss+xml"/><item><title>Assigning IP addresses to a geographical location</title><link>https://www.renemoser.net/blog/2008/12/23/assign-ips-to-geographical-location/</link><pubDate>Tue, 23 Dec 2008 00:00:00 +0000</pubDate><guid>https://www.renemoser.net/blog/2008/12/23/assign-ips-to-geographical-location/</guid><description>Knowing roughly where a visitor is connecting from is genuinely useful: you can send them to the shop of their own country, show events happening near them, or keep whole regions away from your SSH daemon.
It is not, however, something to build a security control on. Visitors behind a proxy in another country, behind a corporate VPN, or coming out of a Tor exit node will be placed wherever their exit point is, and mobile carriers routinely hand out addresses that geolocate hundreds of kilometres from the actual device.</description></item><item><title>Use DNS Blacklists in PHP</title><link>https://www.renemoser.net/blog/2008/12/09/use-dns-blacklists-in-php/</link><pubDate>Tue, 09 Dec 2008 00:00:00 +0000</pubDate><guid>https://www.renemoser.net/blog/2008/12/09/use-dns-blacklists-in-php/</guid><description>A DNS blacklist (DNSBL) is queried like any other DNS name: reverse the octets of the address you want to check, append the zone of the list, and resolve it. If the name resolves, the address is listed. No API keys, no HTTP client, no library — a resolver is all you need.
The snippet below checks one address against a list of DNSBL zones and stops at the first hit.</description></item></channel></rss>