<?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: PHP:Catching keyword from search engine</title>
	<atom:link href="http://www.istanto.net/phpcatching-keyword-from-search-engine.html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.istanto.net/phpcatching-keyword-from-search-engine.html</link>
	<description>Online Business, Short Reviews, Computers and Internet, Tips and Trick, Make Money Online.</description>
	<lastBuildDate>Wed, 08 Feb 2012 07:44:18 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: web site development</title>
		<link>http://www.istanto.net/phpcatching-keyword-from-search-engine.html#comment-36579</link>
		<dc:creator>web site development</dc:creator>
		<pubDate>Wed, 25 Jan 2012 16:16:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.istanto.net/?p=968#comment-36579</guid>
		<description>&lt;strong&gt;web site development...&lt;/strong&gt;

[...]PHP:Catching keyword from search engine ?? Istanto Blogs[...]...</description>
		<content:encoded><![CDATA[<p><strong>web site development&#8230;</strong></p>
<p>[...]PHP:Catching keyword from search engine ?? Istanto Blogs[...]&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tom</title>
		<link>http://www.istanto.net/phpcatching-keyword-from-search-engine.html#comment-4192</link>
		<dc:creator>tom</dc:creator>
		<pubDate>Fri, 11 Jun 2010 06:04:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.istanto.net/?p=968#comment-4192</guid>
		<description>Not so good ...

Too much regex calls. They are heavy functions retarding execution time. if i am the last of 50 search engines, it will have to execute 50 eregi before finding me. Remember that this script is called on almost every pages. In fact, it s called on the most importants pages, the ones we want to target. So we want it fast. Try this code, it makes the same :

$url = parse_url($_SERVER[&#039;HTTP_REFERER&#039;]);
$possibles_params = array(&#039;q&#039;,&#039;qt&#039;,&#039;p&#039;);//&amp;q= &amp;qt= &amp;p= ...
parse_str($url[&#039;query&#039;], $params);
foreach($possibles_params as $val)
{
  if($params[$val]) echo &quot;referer : &quot;.$url[&#039;host&#039;].&quot;keywords : &quot;.$params[$val];
}

Note that it keeps the complete referer name server. Because it can be useful in SEO to know if it is refering from www.google.com, www.google.fr, www.google.co.uk, etc ...

Good luck !</description>
		<content:encoded><![CDATA[<p>Not so good &#8230;</p>
<p>Too much regex calls. They are heavy functions retarding execution time. if i am the last of 50 search engines, it will have to execute 50 eregi before finding me. Remember that this script is called on almost every pages. In fact, it s called on the most importants pages, the ones we want to target. So we want it fast. Try this code, it makes the same :</p>
<p>$url = parse_url($_SERVER['HTTP_REFERER']);<br />
$possibles_params = array(&#8216;q&#8217;,'qt&#8217;,'p&#8217;);//&amp;q= &amp;qt= &amp;p= &#8230;<br />
parse_str($url['query'], $params);<br />
foreach($possibles_params as $val)<br />
{<br />
  if($params[$val]) echo &#8220;referer : &#8220;.$url['host'].&#8221;keywords : &#8220;.$params[$val];<br />
}</p>
<p>Note that it keeps the complete referer name server. Because it can be useful in SEO to know if it is refering from <a href="http://www.google.com" rel="nofollow">http://www.google.com</a>, <a href="http://www.google.fr" rel="nofollow">http://www.google.fr</a>, <a href="http://www.google.co.uk" rel="nofollow">http://www.google.co.uk</a>, etc &#8230;</p>
<p>Good luck !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin</title>
		<link>http://www.istanto.net/phpcatching-keyword-from-search-engine.html#comment-3642</link>
		<dc:creator>Martin</dc:creator>
		<pubDate>Sat, 03 Apr 2010 15:21:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.istanto.net/?p=968#comment-3642</guid>
		<description>I only receive this on my page:

get_keys(); if (count($keys)) { echo &quot;You&#039;re directed to this page from $keys[2] search engine, within Keywords &#039;$keys[1]&#039;
&quot;; } ?&gt;

(it is a .shtml and I set the httpd.conf to AddType application/x-httpd-php .shtml)</description>
		<content:encoded><![CDATA[<p>I only receive this on my page:</p>
<p>get_keys(); if (count($keys)) { echo &#8220;You&#8217;re directed to this page from $keys[2] search engine, within Keywords &#8216;$keys[1]&#8216;<br />
&#8220;; } ?&gt;</p>
<p>(it is a .shtml and I set the httpd.conf to AddType application/x-httpd-php .shtml)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ekofuji</title>
		<link>http://www.istanto.net/phpcatching-keyword-from-search-engine.html#comment-3543</link>
		<dc:creator>ekofuji</dc:creator>
		<pubDate>Mon, 22 Mar 2010 00:53:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.istanto.net/?p=968#comment-3543</guid>
		<description>if a great script. thank you...</description>
		<content:encoded><![CDATA[<p>if a great script. thank you&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fil</title>
		<link>http://www.istanto.net/phpcatching-keyword-from-search-engine.html#comment-3451</link>
		<dc:creator>Fil</dc:creator>
		<pubDate>Tue, 09 Mar 2010 00:59:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.istanto.net/?p=968#comment-3451</guid>
		<description>You keywords will be empty when try to get from 
http://www.google.com/search?hl=en&amp;q=example+keywords
this query has q=example+keywords but not end with &amp;</description>
		<content:encoded><![CDATA[<p>You keywords will be empty when try to get from<br />
<a href="http://www.google.com/search?hl=en&#038;q=example+keywords" rel="nofollow">http://www.google.com/search?hl=en&#038;q=example+keywords</a><br />
this query has q=example+keywords but not end with &amp;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Dohrenburg</title>
		<link>http://www.istanto.net/phpcatching-keyword-from-search-engine.html#comment-3384</link>
		<dc:creator>Robert Dohrenburg</dc:creator>
		<pubDate>Fri, 26 Feb 2010 06:41:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.istanto.net/?p=968#comment-3384</guid>
		<description>Don&#039;t forget to add Bing :)

// Microsoft Bing
preg_match ( &quot;/{$this-&gt;sep}q=(.*?)\&amp;/si&quot;, $this-&gt;referer, $matches );
$this-&gt;keys = urldecode ( $matches[1] );
$this-&gt;search_engine = &quot;Bing&quot;;</description>
		<content:encoded><![CDATA[<p>Don&#8217;t forget to add Bing <img src='http://www.istanto.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>// Microsoft Bing<br />
preg_match ( &#8220;/{$this-&gt;sep}q=(.*?)\&amp;/si&#8221;, $this-&gt;referer, $matches );<br />
$this-&gt;keys = urldecode ( $matches[1] );<br />
$this-&gt;search_engine = &#8220;Bing&#8221;;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

