<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Capture user IP, location and referring URL</title>
	<atom:link href="http://www.iamseo.org/how-to/capture-user-ip-location-and-referring-url/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.iamseo.org/how-to/capture-user-ip-location-and-referring-url/</link>
	<description>Just another (SEO) Wordpress weblog</description>
	<lastBuildDate>Wed, 26 May 2010 18:11:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Morris</title>
		<link>http://www.iamseo.org/how-to/capture-user-ip-location-and-referring-url/comment-page-1/#comment-1009</link>
		<dc:creator>Morris</dc:creator>
		<pubDate>Wed, 07 Apr 2010 15:17:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.iamseo.org/?p=105#comment-1009</guid>
		<description>Thanks a lot for your suggestions – I appreciate it. 

I&#039;m actually submitting the form to a third party (Campaign Monitor), so I&#039;m not sure how possible it is to pass it through another submit.php type page and add the IP stuff there. 

I also understand the downside of using a third party to find the location of the IP, though uploading and sourcing the country code MySQL stuff was a bit beyond me, this time :)

Thanks again.</description>
		<content:encoded><![CDATA[<p>Thanks a lot for your suggestions – I appreciate it. </p>
<p>I&#8217;m actually submitting the form to a third party (Campaign Monitor), so I&#8217;m not sure how possible it is to pass it through another submit.php type page and add the IP stuff there. </p>
<p>I also understand the downside of using a third party to find the location of the IP, though uploading and sourcing the country code MySQL stuff was a bit beyond me, this time <img src='http://www.iamseo.org/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Thanks again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: andy</title>
		<link>http://www.iamseo.org/how-to/capture-user-ip-location-and-referring-url/comment-page-1/#comment-1008</link>
		<dc:creator>andy</dc:creator>
		<pubDate>Wed, 07 Apr 2010 11:45:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.iamseo.org/?p=105#comment-1008</guid>
		<description>The submission script would be the file the form gets posted to. I see in your &quot;action&quot; you have &quot;http://site.com/&quot;, lets start from there.

say your &quot;action&quot; is &quot;http://site.com/submit.php&quot;, the submission script would be submit.php

In submit.php, you would have all your validation:

check &quot;name&quot; is not empty with: 
if(strlen($name) == &#039;0&#039;){
//do something on error
}
check &quot;email&quot; is valid with check_email_address() function found here: http://www.linuxjournal.com/article/9585

remember to do something on error again

After validation, you&#039;d then do your IP check before inserting into the database and redirecting to the &quot;Thank you&quot; page.

The only problem would be that $_SERVER[&#039;HTTP_REFERRER&#039;] in submit.php would be the page where your form is, so you&#039;d still need that in your hidden fields. Or use cookies, which you&#039;ve already ruled out.

The reason Im saying do the IP stuff in your submit page is:
A) hidden fields can be overwritten by robots
B) you&#039;re depending on a 3rd party script for information, if there&#039;s a hang at the 3rd party site, the form would take ages to load in and you&#039;ll lose your user.

Your theory is sound enough Morris, it&#039;s just the location of certain parts that could be improved to give a better user experience equaling more leads + more money for you.</description>
		<content:encoded><![CDATA[<p>The submission script would be the file the form gets posted to. I see in your &#8220;action&#8221; you have &#8220;http://site.com/&#8221;, lets start from there.</p>
<p>say your &#8220;action&#8221; is &#8220;http://site.com/submit.php&#8221;, the submission script would be submit.php</p>
<p>In submit.php, you would have all your validation:</p>
<p>check &#8220;name&#8221; is not empty with:<br />
if(strlen($name) == &#8216;0&#8242;){<br />
//do something on error<br />
}<br />
check &#8220;email&#8221; is valid with check_email_address() function found here: <a href="http://www.linuxjournal.com/article/9585" rel="nofollow">http://www.linuxjournal.com/article/9585</a></p>
<p>remember to do something on error again</p>
<p>After validation, you&#8217;d then do your IP check before inserting into the database and redirecting to the &#8220;Thank you&#8221; page.</p>
<p>The only problem would be that $_SERVER['HTTP_REFERRER'] in submit.php would be the page where your form is, so you&#8217;d still need that in your hidden fields. Or use cookies, which you&#8217;ve already ruled out.</p>
<p>The reason Im saying do the IP stuff in your submit page is:<br />
A) hidden fields can be overwritten by robots<br />
B) you&#8217;re depending on a 3rd party script for information, if there&#8217;s a hang at the 3rd party site, the form would take ages to load in and you&#8217;ll lose your user.</p>
<p>Your theory is sound enough Morris, it&#8217;s just the location of certain parts that could be improved to give a better user experience equaling more leads + more money for you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Morris</title>
		<link>http://www.iamseo.org/how-to/capture-user-ip-location-and-referring-url/comment-page-1/#comment-1001</link>
		<dc:creator>Morris</dc:creator>
		<pubDate>Mon, 05 Apr 2010 17:51:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.iamseo.org/?p=105#comment-1001</guid>
		<description>How do you suggest I do that, working with the above code? Thanks for your advice.</description>
		<content:encoded><![CDATA[<p>How do you suggest I do that, working with the above code? Thanks for your advice.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: andy</title>
		<link>http://www.iamseo.org/how-to/capture-user-ip-location-and-referring-url/comment-page-1/#comment-1000</link>
		<dc:creator>andy</dc:creator>
		<pubDate>Mon, 05 Apr 2010 16:27:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.iamseo.org/?p=105#comment-1000</guid>
		<description>putting this info into hidden fields is pointless and potentially buggy. Your form submits to a script, so get that info in the submission script away from th users form markup or scam robots interaction. The only exception would be th referrer info, which could stay in th hidden field, but again, its potentially buggy. 
Dont forget the sanity checks serverside too.</description>
		<content:encoded><![CDATA[<p>putting this info into hidden fields is pointless and potentially buggy. Your form submits to a script, so get that info in the submission script away from th users form markup or scam robots interaction. The only exception would be th referrer info, which could stay in th hidden field, but again, its potentially buggy.<br />
Dont forget the sanity checks serverside too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Capture user&#8217;s IP, location and referring URL in subscriber form</title>
		<link>http://www.iamseo.org/how-to/capture-user-ip-location-and-referring-url/comment-page-1/#comment-993</link>
		<dc:creator>Capture user&#8217;s IP, location and referring URL in subscriber form</dc:creator>
		<pubDate>Sun, 31 Jan 2010 21:12:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.iamseo.org/?p=105#comment-993</guid>
		<description>[...] &#13; http://www.iamseo.org/how-to/capture&#8230;referring-url/&#13; [...]</description>
		<content:encoded><![CDATA[<p>[...] &#13; <a href="http://www.iamseo.org/how-to/capture&#8230;referring-url/&#13">http://www.iamseo.org/how-to/capture&#8230;referring-url/&#13</a>; [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
