PDA

View Full Version : Meta Tag Function


Element
11-28-2005, 01:16 AM
I havn't played with this for a long time but I still don't know why it doesn't work. Can anyone help?

<?php

function MetaTags($url) {

$meta = get_meta_tags('$url');

$tags = array ("url" => $url,
"author" => $meta['author'],
"keywords" => $meta['keywords'],
"description" => $meta['description'],
"geo_position" =>$meta['geo_position']);

return $tags;

}

$string = "http://shack-cafe.com/index.php";
$the_meta = MetaTags($string);

echo 'Author: <a href="mailto:'.$the_meta['author'].'">Email</a><br>Description: '.$the_meta['description'].'<br><font color="#999999"><i>Keywords: '.$the_meta['keywords'].'</i></font>';

?>

Velox Letum
11-28-2005, 01:47 AM
$meta = get_meta_tags('$url');
You have the variable in single quotes. Change to:

$meta = get_meta_tags($url);
Its pretty easy to miss things like that ;)

Element
11-28-2005, 02:30 AM
$meta = get_meta_tags('$url');
You have the variable in single quotes. Change to:

$meta = get_meta_tags($url);
Its pretty easy to miss things like that ;)

Doi! Thanks.