<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Design Gala &#187; vistor tracking</title>
	<atom:link href="http://designgala.com/tag/vistor-tracking/feed/" rel="self" type="application/rss+xml" />
	<link>http://designgala.com</link>
	<description>Web Usability, Web Technology, User Experience</description>
	<lastBuildDate>Sat, 11 Jun 2011 02:38:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>How to Get IP Address of Visitor</title>
		<link>http://designgala.com/how-to-get-ip-address-of-visitor/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-get-ip-address-of-visitor</link>
		<comments>http://designgala.com/how-to-get-ip-address-of-visitor/#comments</comments>
		<pubDate>Tue, 15 May 2007 20:09:03 +0000</pubDate>
		<dc:creator>Design Gala</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[remote IP]]></category>
		<category><![CDATA[vistor tracking]]></category>

		<guid isPermaLink="false">http://www.designgala.com/?p=3</guid>
		<description><![CDATA[This is a simple PHP tutorials and script for getting remote visitors with their IP Address. With this tracking your visitor is very easy and simple with PHP. PHP has a set of...]]></description>
			<content:encoded><![CDATA[<p><span class="firstletter"><span>T</span></span>his is a simple <abbr title="PHP Hypertext Processor">PHP</abbr> tutorials and script for getting remote visitors with their IP Address. With this tracking your visitor is very easy and simple with <abbr title="PHP Hypertext Processor">PHP</abbr>. <abbr title="PHP Hypertext Processor">PHP</abbr> has a set of global variables. Among them, we use $_SERVER variable to get an IP address of a remote computer. REMOTE_ADDR is the constant that is used to get the IP Address of a remote computer.</p>
<p>Note that this script may not return IP Address if the client/user firewall is on or when client is using some proxy software.</p>
<div class="wp_syntax">
<table>
<tr>
<td class="line_numbers">
<pre>1
2
3
4
</pre>
</td>
<td class="code">
<pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span> ?php
 <span style="color: #000088;">$ipaddress</span><span style="color: #339933;">=</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;REMOTE_ADDR&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
 <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Your IP ADDRESS: &quot;</span><span style="color: #339933;">.</span> <span style="color: #000088;">$ipaddress</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre>
</td>
</tr>
</table>
</div>
<p>Another way of retrieving IP Address is using function getenv().</p>
<div class="wp_syntax">
<table>
<tr>
<td class="line_numbers">
<pre>1
2
3
4
5
</pre>
</td>
<td class="code">
<pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span> ?php
 <span style="color: #000088;">$userip</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;HTTP_X_FORWARDED_FOR&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$proxy</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;REMOTE_ADDR&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$host</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><span style="color: #990000;">gethostbyaddr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;HTTP_X_FORWARDED_FOR&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre>
</td>
</tr>
</table>
</div>
<p><!--adsense#longbottom--></p>
<h3>OUTPUT</h3>
<div class="wp_syntax">
<div class="code">
<pre class="php" style="font-family:monospace;">Server IP ADDRESS<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><span style="color: #990000;">exec</span><span style="color: #009900;">&#93;</span><span style="color: #b1b100;">echo</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;HTTP_X_FORWARDED_FOR&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#91;</span><span style="color: #339933;">/</span><span style="color: #990000;">exec</span><span style="color: #009900;">&#93;</span>
User IP ADDRESS<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><span style="color: #990000;">exec</span><span style="color: #009900;">&#93;</span><span style="color: #b1b100;">echo</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;REMOTE_ADDR&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#91;</span><span style="color: #339933;">/</span><span style="color: #990000;">exec</span><span style="color: #009900;">&#93;</span>
User HOST ADDRESS<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><span style="color: #990000;">exec</span><span style="color: #009900;">&#93;</span><span style="color: #b1b100;">echo</span> <span style="color: #339933;">@</span><span style="color: #990000;">gethostbyaddr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;HTTP_X_FORWARDED_FOR&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#91;</span><span style="color: #339933;">/</span><span style="color: #990000;">exec</span><span style="color: #009900;">&#93;</span></pre>
</div>
</div>
<blockquote><p>$userip is the IP address of the user thats been passed on by the server. $proxy is the IP address of the server itself and $host is the host address of the user. If your PHP version is less than 4.3 then use $HTTP_SERVER_VARS in place of $_SERVER</p></blockquote>
<p>Download : <a href="http://www.designgala.com/wp-content/uploads/2008/03/how-to-get-ip-address-of-visitorphp.txt" title="PHP Script Get IP Address of Visitor">PHP Script Get IP Address of Visitor</a>
<div id="fb-root"></div>
<p><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><!-- Do not remove --></p>
]]></content:encoded>
			<wfw:commentRss>http://designgala.com/how-to-get-ip-address-of-visitor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

