<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr</title>
<link>http://snipplr.com/language/php/tags/ip</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Wed, 15 Feb 2012 01:08:18 GMT</pubDate>
<item>
<title>(PHP) Get Visitor IP - mantosz</title>
<link>http://snipplr.com/view/57465/get-visitor-ip/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Mon, 01 Aug 2011 17:10:42 GMT</pubDate>
<guid>http://snipplr.com/view/57465/get-visitor-ip/</guid>
</item>
<item>
<title>(PHP) Block IP address - ariunbolor</title>
<link>http://snipplr.com/view/57035/block-ip-address/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Fri, 22 Jul 2011 17:13:19 GMT</pubDate>
<guid>http://snipplr.com/view/57035/block-ip-address/</guid>
</item>
<item>
<title>(PHP) Get your visitors IP address - ariunbolor</title>
<link>http://snipplr.com/view/57033/get-your-visitors-ip-address/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Fri, 22 Jul 2011 17:10:41 GMT</pubDate>
<guid>http://snipplr.com/view/57033/get-your-visitors-ip-address/</guid>
</item>
<item>
<title>(PHP) Get user IP Address with PHP - Push</title>
<link>http://snipplr.com/view/56890/get-user-ip-address-with-php/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Wed, 20 Jul 2011 07:36:19 GMT</pubDate>
<guid>http://snipplr.com/view/56890/get-user-ip-address-with-php/</guid>
</item>
<item>
<title>(PHP) Own DynDns Service, serverside script. - madc</title>
<link>http://snipplr.com/view/55482/own-dyndns-service-serverside-script/</link>
<description><![CDATA[ <p>Serverside script for a personal DynDNS service.
Works together with a clientside script written in ruby [ http://snipplr.com/view/55484/own-dyndns-service-clientside-script/ ] .

Redirect to current saved IP(http, port 80):
http://dynDns.yourveryownhost.com/

Update with current IP:
http://dynDns.yourveryownhost.com/?updateIp

Show saved IP:
http://dynDns.yourveryownhost.com/?showIp

The getIpAddr-function is based on a blog-post written by Roshan Bhattarai [ http://roshanbh.com.np/2007/12/getting-real-ip-address-in-php.html ]</p> ]]></description>
<pubDate>Sun, 19 Jun 2011 21:23:15 GMT</pubDate>
<guid>http://snipplr.com/view/55482/own-dyndns-service-serverside-script/</guid>
</item>
<item>
<title>(PHP) Obtaining IP and host of visitor - michaJlS</title>
<link>http://snipplr.com/view/55106/obtaining-ip-and-host-of-visitor/</link>
<description><![CDATA[ <p>This piece of code is at least ten years old and I don't remember exactly, where I have found it. Probably it had been stolen from my friend VeZyR;)</p> ]]></description>
<pubDate>Fri, 10 Jun 2011 03:19:00 GMT</pubDate>
<guid>http://snipplr.com/view/55106/obtaining-ip-and-host-of-visitor/</guid>
</item>
<item>
<title>(PHP) check allowed Ip\'s (use the magento developer IP) - nico65</title>
<link>http://snipplr.com/view/54747/check-allowed-ips-use-the-magento-developer-ip/</link>
<description><![CDATA[ <p>use the magento developer IP</p> ]]></description>
<pubDate>Thu, 02 Jun 2011 03:31:53 GMT</pubDate>
<guid>http://snipplr.com/view/54747/check-allowed-ips-use-the-magento-developer-ip/</guid>
</item>
<item>
<title>(PHP) Hostname class - lasavior</title>
<link>http://snipplr.com/view/54138/hostname-class/</link>
<description><![CDATA[ <p>PHP class to restrict a script to only run on a set ip address. This takes into account a static hostname (via one of the freely available such as dyndns.org) and a travelling ip. See the description and instructions for more information.</p> ]]></description>
<pubDate>Sun, 22 May 2011 09:29:46 GMT</pubDate>
<guid>http://snipplr.com/view/54138/hostname-class/</guid>
</item>
<item>
<title>(PHP) PHP ip address getter - merrittwjm</title>
<link>http://snipplr.com/view/51346/php-ip-address-getter/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 31 Mar 2011 02:03:15 GMT</pubDate>
<guid>http://snipplr.com/view/51346/php-ip-address-getter/</guid>
</item>
<item>
<title>(PHP) GetIPaddress - Ideandro</title>
<link>http://snipplr.com/view/49894/getipaddress/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Wed, 02 Mar 2011 07:23:30 GMT</pubDate>
<guid>http://snipplr.com/view/49894/getipaddress/</guid>
</item>
<item>
<title>(PHP) Detect Location by IP (City, State) - crypticsoft</title>
<link>http://snipplr.com/view/48386/detect-location-by-ip-city-state/</link>
<description><![CDATA[ <p>returns "City, State" if found otherwise defaults to "Hollywood, CA"</p> ]]></description>
<pubDate>Fri, 04 Feb 2011 09:07:03 GMT</pubDate>
<guid>http://snipplr.com/view/48386/detect-location-by-ip-city-state/</guid>
</item>
<item>
<title>(PHP) Get IP Address - kendsnyder</title>
<link>http://snipplr.com/view/47386/get-ip-address/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Tue, 18 Jan 2011 04:11:08 GMT</pubDate>
<guid>http://snipplr.com/view/47386/get-ip-address/</guid>
</item>
<item>
<title>(PHP) Better Client/Remote IP function. - YPY</title>
<link>http://snipplr.com/view/42092/better-clientremote-ip-function/</link>
<description><![CDATA[ <p>Better Client/Remote IP function</p> ]]></description>
<pubDate>Tue, 12 Oct 2010 06:54:59 GMT</pubDate>
<guid>http://snipplr.com/view/42092/better-clientremote-ip-function/</guid>
</item>
<item>
<title>(PHP) Online/Offline ip adress - nveselinov</title>
<link>http://snipplr.com/view/42080/onlineoffline-ip-adress/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Tue, 12 Oct 2010 04:41:22 GMT</pubDate>
<guid>http://snipplr.com/view/42080/onlineoffline-ip-adress/</guid>
</item>
<item>
<title>(PHP) get_ip - mladoux</title>
<link>http://snipplr.com/view/40870/getip/</link>
<description><![CDATA[ <p>A simple IP address utility that first attempts to get the users IP via X\_FORWARDED\_FOR headers, and if they are not available, then resorts to the TCP/IP stack.</p> ]]></description>
<pubDate>Wed, 22 Sep 2010 00:25:12 GMT</pubDate>
<guid>http://snipplr.com/view/40870/getip/</guid>
</item>
<item>
<title>(PHP) Get Visitors IP Address - sandrews_06</title>
<link>http://snipplr.com/view/39918/get-visitors-ip-address/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Fri, 03 Sep 2010 01:16:54 GMT</pubDate>
<guid>http://snipplr.com/view/39918/get-visitors-ip-address/</guid>
</item>
<item>
<title>(PHP) getIP function - stancox</title>
<link>http://snipplr.com/view/38782/getip-function/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Mon, 09 Aug 2010 22:12:16 GMT</pubDate>
<guid>http://snipplr.com/view/38782/getip-function/</guid>
</item>
<item>
<title>(PHP) IP Poll Restriction - jretamal</title>
<link>http://snipplr.com/view/35765/ip-poll-restriction/</link>
<description><![CDATA[ <p>Restricts the vote to one vote per ip per day</p> ]]></description>
<pubDate>Tue, 15 Jun 2010 22:13:41 GMT</pubDate>
<guid>http://snipplr.com/view/35765/ip-poll-restriction/</guid>
</item>
<item>
<title>(PHP) Get Real IP Address of Client - jrobinsonc</title>
<link>http://snipplr.com/view/30918/get-real-ip-address-of-client/</link>
<description><![CDATA[ <p>This function will fetch the real IP address of the user even if he is behind a proxy server.</p> ]]></description>
<pubDate>Mon, 05 Apr 2010 08:15:18 GMT</pubDate>
<guid>http://snipplr.com/view/30918/get-real-ip-address-of-client/</guid>
</item>
<item>
<title>(PHP) PHP Based Access Blocking Version 2.0 - MMDeveloper</title>
<link>http://snipplr.com/view/25665/php-based-access-blocking-version-20/</link>
<description><![CDATA[ <p>This is a new version of a previous snippet I wrote. This version is smaller, more efficient, and allows the use of regular expressions. To use:

	$blocker = new blocker();
	if ($blocker->isBlocked === true) {
		//blocked user, do whatever
	} else {}


OR if you want to test IF a certain IP or hostname or user agent WOULD be blocked:

	$blocker = new blocker();
	list($isBlocked, $reasonsBlocked) = $blocker->testIfBlocked([userIP], [userAgent], [userHostname]);
	if ($isBlocked === true) {
		print_r($reasonsBlocked);
	} else {}

The 3 arguments are optional, but if specified, must be specified in that order. Any unspecified arguments will default to the values of the user executing the call. For example, if you do not specify a user agent and host name, and you're the one executing the test, it will use YOUR user agent and host name. An array of reasons why the test said you failed will be returned (along with a boolean true/false as to if the criteria would be blocked or not).</p> ]]></description>
<pubDate>Tue, 29 Dec 2009 11:12:12 GMT</pubDate>
<guid>http://snipplr.com/view/25665/php-based-access-blocking-version-20/</guid>
</item>
</channel>
</rss>
