You are here: Re: How 2 include meta tags? « PHP Language « IT news, forums, messages
Re: How 2 include meta tags?

Posted by Geoff Berrow on 05/04/07 09:11

Message-ID: <pjpl33l070pu143dotrmouf0r0t9858ms5@4ax.com> from tochiro
contained the following:

>I would like to have different meta tags for each page. What it the
>most effective method to do that without access to a data base?

Serve up different meta tags from an array of meta tags depending on the
page.

First setup an array containing the various different header info

<?php
$meta['index.php']="index meta tags go here";
$meta['page1.php']="page1 meta tags go here";
$meta['page2.php']="page2 meta tags go here";
....

//Then get the file name of the page that is including the headers

$parts=explode("/",$_SERVER['PHP_SELF']);
$file=$parts[(count($parts)-1)];

//Then simply echo the appropriate array element
echo $meta[$file];
?>



--
Geoff Berrow 0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация