I want to get keywords that you can find on my website
example me code
pcboxsearch.class.php
<?php
class search_keywords
{
var $referer;
var $search_engine;
var $keys;
var $sep;
function search_keywords()
{
$this->referer = '';
$this->sep = '';
if ($_SERVER['HTTP_REFERER'] OR $_ENV['HTTP_REFERER'])
{
$this->referer = urldecode(($_SERVER['HTTP_REFERER'] ? $_SERVER['HTTP_REFERER'] : $_ENV['HTTP_REFERER']));
$this->sep = (eregi('(\?q=|\?qt=|\?p=)', $this->referer)) ? '\?' : '\&';
}
}
function get_keys()
{
if (!empty($this->referer))
{
if (eregi('www\.google', $this->referer))
{
preg_match("#{$this->sep}q=(.*?)\&#si", $this->referer, $this->keys);
$this->search_engine = 'Google';
}
else if (eregi('(yahoo\.com|search\.yahoo)', $this->referer))
{
preg_match("#{$this->sep}p=(.*?)\&#si", $this->referer, $this->keys);
$this->search_engine = 'Yahoo';
}
else if (eregi('search\.msn', $this->referer))
{
preg_match("#{$this->sep}q=(.*?)\&#si", $this->referer, $this->keys);
$this->search_engine = 'MSN';
}
else if (eregi('www\.alltheweb', $this->referer))
{
preg_match("#{$this->sep}q=(.*?)\&#si", $this->referer, $this->keys);
$this->search_engine = 'AllTheWeb';
}
else if (eregi('(looksmart\.com|search\.looksmart)', $this->referer))
{
preg_match("#{$this->sep}qt=(.*?)\&#si", $this->referer, $this->keys);
$this->search_engine = 'Looksmart';
}
else if (eregi('(askjeeves\.com|ask\.com)', $this->referer))
{
preg_match("#{$this->sep}q=(.*?)\&#si", $this->referer, $this->keys);
$this->search_engine = 'AskJeeves';
}
else
{
$this-> keys = 'Not available';
$this->search_engine = 'Unknown';
}
return array(
$this->referer,
(!is_array($this->keys) ? $this->keys : $this->keys[1]),
$this->search_engine
);
}
return array();
}
}
?>
index.php
<?php
require_once('./pcboxsearch.class.php');
$keys =& new search_keywords();
$keys = $keys->get_keys();
$url ='a href="http://www.pcboxsearch.com/search.php?q="';
if (count($keys))
{
echo "You're directed to this page from <b>$keys[2]</b> search engine, within Keywords <b>$url$keys[1]</a> </b> If you Like Pcboxsearch Found You search<br>";
}
?>
output code index.php
You're directed to this page from "google" search engine, within Keywords "code poject" If you Like Pcboxsearch Found You search
I've tried this keyword not respont
$url ='href="http://www.pcboxsearch.com/search.php?q='+ $keys[1];
questions
how to combine keywords found make url
example, if found "projec code" becomes url = http://www.pcboxsearch.com/search.php?q=code projec
because me code not response keyword "http://www.pcboxsearch.com/search.php?q="
Can you help me where do I join as a url into my search engine