META Tag Generator
Meta Tag Generator is a tool to debug and generate meta tag code for any website. Meta tags can be used to provide information to all sorts of clients, and each system processes only the meta tags they understand and ignores the rest.
if(isset($_GET['action'])){
$action = $_GET['action'];
}else
$action = NULL;
if(isset($_POST['getmetafrompage'])){
$getmetafrompage = $_POST['getmetafrompage'];
}else
$getmetafrompage = NULL;
if ($action == "generate")
{
print "Insert the following HTML code between the <HEAD> tags of your site:";
print "
";
print "
Create another set of meta tags ";
}
else
{
if (isset($_POST['getmetafrompage']))
{
function fetchfiletolocal($url){
$filename = "uploads/".randomized(15).".html";
$flagr = ini_get("allow_url_fopen");
if($flagr == 1){
$html = @file_get_contents($url);
}
else{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$start = microtime(true);
$html = curl_exec($ch);
curl_close($ch);
}
$fhandler = fopen($filename,"w");
fwrite($fhandler,$html);
fclose($fhandler);
return $filename;
}
function randomized($size){
$seed = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$output = "";
for($i = 0; $i < $size; $i++){
$rand = mt_rand(0,61);
$output .= $seed[$rand];
}
return $output;
}
$filename = fetchfiletolocal($_POST['getmetafrompage']);
$MetaTags = get_meta_tags($filename);
}
if(isset($MetaTags["description"]))
$description = $MetaTags["description"];
else
$description = NULL;
if(isset($MetaTags["keywords"]))
$keywords = $MetaTags["keywords"];
else
$keywords = NULL;
if(isset($MetaTags["robots"]))
$robot = $MetaTags["robots"];
else if(isset($MetaTags["robot"]))
$robot = $MetaTags["robot"];
else
$robot = NULL;
if(isset($MetaTags["author"]))
$author = $MetaTags["author"];
else if(isset($MetaTags["owner"]))
$author = $MetaTags["owner"];
else
$author = NULL;
if(isset($MetaTags["refresh"]))
$refresh = $MetaTags["refresh"];
else
$refresh = NULL;
if(isset($MetaTags["copyright"]))
$copyright = $MetaTags["copyright"];
if(isset($MetaTags["dc_rights"]))
$copyright = $MetaTags["dc_rights"];
else
$copyright = NULL;
if(isset($MetaTags["revisit-after"]))
$revisit = $MetaTags["revisit-after"];
else
$revisit = NULL;
if(isset($MetaTags["generator"]))
$generator = $MetaTags["generator"];
else
$generator = NULL;
if(isset($MetaTags["language"]))
$language = $MetaTags["language"];
else
$language = NULL;
date_default_timezone_set('Asia/Kolkata');
$year = date('y');
print "
";
print " ";
print "
If your page already has META tags you may import and edit them. ";
print " ";
print "
";
print "Site Description: ";
print "Site Keywords: (Seperate with commas): $keywords ";
//print "";
print "Optional information: (Check the tags you would like to include)
";
print " What should robots do?";
print " ";
if (isset($robot))
print "$robot ";
print "Index this page and follow all links Don't index this page and don't follow any links ";
print "Index this page, but don't follow any links Don't index this page, but follow links
";
print " Refresh this page after seconds
";
print " Copyright line:
";
print " Author:
";
print " Generator:
";
print " Language:
";
print " Search engines should revisit this page after days.
";
print "
";
print "
";
}
?>