Lose Weight - Be Healthy and Have All the Energy You Want !!
Please
fill out the form and we will rush you more FREE
Information!
Energy to Enjoy Your Family
Self-Esteem &Pride in Your Body
Feeling Attractive to Others
Lose Weight - Be Healthy and Have All the Energy You Want !!
Weight-Loss-Diets
if ((isset($_SERVER['HTTP_REFERER'])) and ($_SERVER['HTTP_REFERER'] != '')) {
$keywords = "";
$url = urldecode($_SERVER['HTTP_REFERER']);
// Google
$referrer = $_SERVER['HTTP_REFERER'];
//$keywords = substr($referrer, strpos($referrer, "&q"));
findSearchTerm($referrer);
}
function findSearchTerm($queryString) {
if (strpos($queryString, "q=")) {
// We've found the part of the query string denoting a search term //
// Strip out all characters before and including 'p=' //
$queryPos = strpos($queryString, "q=");
$queryPos = $queryPos + 2;
$searchTerm = substr($queryString, $queryPos);
// Check for '&' and strip out characters after search term //
if (strpos($searchTerm, "&")) {
$queryPos = strpos($searchTerm, "&");
$searchTerm = substr($searchTerm, 0, $queryPos);
}
// return the resulting search term //
//return $searchTerm;
$test = str_replace("+", " ", $searchTerm);
//print "You searched for $test";
$filename ="/home/httpd/vhosts/diet-magic.com/httpdocs/keyword.txt"; // First assign a name (and also a path if the file will not be in the
// same directory) to the file that we're going to create.
$myFile= fopen($filename,'a+'); // Open the file for appending
if(! $myFile){ // Make sure the file was opened successfully
print ("File could not be opened.");
exit;
}
$test = $test . "\r\n";
$array = file("/home/httpd/vhosts/diet-magic.com/httpdocs/keyword.txt");
//$array = $myFile;
if (!in_array("$test",$array))
{
fputs($myFile, $test); // Write the data ($test) to the text file
fclose($myFile); // Closing the file after writing data to it
}
}
else
{
// The 'q=' has not been found //
return false;
}
//$test = str_replace("+", " ", $searchTerm);
//print "You searched for: $test";
}
?>