/*
============================================================================================================
Version : 1.0
Description : Free Keyword Density Analysis Tool
Copyright : (c) SeoBook.com, licensed under the GPL ( http://www.gnu.org/licenses/gpl.txt )
Function : Allows you to view the keyword density of a page.
============================================================================================================
*/
include '../header.php';
error_reporting(0);
$url=$_REQUEST['url'];
//getting content
include 'clsUltimateSEO.php';
//he entered url , let's work
switch ($_REQUEST[c])
{
case 1:
{
if(strlen($url)==0) {echo "
Please enter url";break;}
$url_backup=$url;
if(strpos($url,'http://')===false) $url='http://'.$url;
$ultimate = &New ultimate;
$ultimate->minoc=$_POST[minoc];
$ultimate->minlength=$_POST[minlength]+1;
$page=$ultimate->getUrl($url);
if($page===false)
{
}
else
{
//extracting meta-tags : title,keywords,description
$tags=$ultimate->_parseTags($page);
//extracting only text from html
$text=$ultimate->getOnlyText($page);
if($_POST[ikey]==1) $text=$text." ".$tags[keywords];
if($_POST[ides]==1) $text=$text." ".$tags[description];
//erasing stop words
if($_POST[stopwords]==1)
{
$handle = fopen("stop_words.txt", "r");
while (!feof($handle))
{
$buffer = fgets($handle, 4096);
$buffer=" ".trim($buffer)." ";
if(strlen(trim($buffer))>0) $text = ereg_replace(strtolower($buffer)," ",strtolower($text));
}
fclose($handle);
}
//end erasing stop words
//echo $text;
//getting 1 word
$nrWords=$ultimate->getNrWords($text);
$res_counts_1=array();
$res_counts_1=$ultimate->getCounts($text);
//getting 2 words
$res_counts_2=array();
$res_counts_2=$ultimate->getCounts_2($text);
//getting 3 words
$res_counts_3=array();
$res_counts_3=$ultimate->getCounts_3($text);
//output results table
include 'results.php';
break;
}
}
}
include 'form.php';
include '../footer.php';
?>