Welcome! Log In Create A New Profile



Posted by 3x2f 
February 16, 2009 04:53PM
Hey Here I have a keywords metatag

* Build a Keywords Metatag
function metaKeywords(){

global $mysql_table_prefix;
//open meta
$meta='<meta name="keywords" content="3x2f - Triple X To Find, ';
//build query log keywords
$queryLog = "SELECT query AS keyword, COUNT(*) AS quantity FROM ".$mysql_table_prefix."query_log WHERE results > 0 GROUP BY query ORDER BY query ASC LIMIT 50";
//build query categories keywords
$queryCtegories = "SELECT category AS keyword FROM ".$mysql_table_prefix."categories GROUP BY category ORDER BY category ASC LIMIT 50";
//excetute queries
$resultLog = mysql_query($queryLog) or die(mysql_error());
$resultCat = mysql_query($queryCtegories) or die(mysql_error());
//build categories keyword list
while ($row = mysql_fetch_array($resultCat)) {
$meta.=$row['keyword'].', ';
//build query log keywords list
while ($row = mysql_fetch_array($resultLog)) {
$meta.=$row['keyword'].', ';
//close meta
$meta.='" />';
return $meta;

I hope this be usefull for any

http://www.3x2f.com ( comming soon...)
Re: SEO-Keywords-Metatag
February 16, 2009 06:07PM
What can we do with this code?
Re: SEO-Keywords-Metatag
February 16, 2009 11:34PM
You can put the function inside your HTML/XHTML header like this:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>My website Title</title>

You must put the mod-function inside commonfuncs.php.

$meta='<meta name="keywords" content="3x2f - Triple X To Find, ';
$meta='<meta name="keywords" content="';
Re: SEO-Keywords-Metatag
February 16, 2009 11:55PM
I see,

Thanks for clearing this up.

Does it matter where I insert the function?
I put it at the very end and it works.

Although, to be honest, I don´t see much use in keywords meta tag, I don´t use it on my site as I believe Google ignores it.

And keywords made up of the most used queries seems a bit funny to me as many queries people use on my site are pretty senseless, to say the least. :-)
Sorry, only registered users may post in this forum.

Click here to login