correct it's for directory. when i include directory in meta_txt it works perfect. but I don't know how to stript the directory in get_meta.php.
what about meta information disapeearing http://www.ritzinfotek.in/ not the index.php
oh. everything works when it hosted in server. It won't work on my wamp local server..
see it here.. http://www.ritzinfotek.in
so I repeated the variable once more time but now the meta is taking but from the las line of database.. :
while($data = fgetcsv($meta_db, 9000, '|'))
{
if($data[0] == $page)
{
$data[1]=$title;
$data[2]=$meta_keywords;
$data[3]=$meta_description;
}
$title = $data[1];
$meta_keywords = $data[2];
$meta_description = $data[3];
}
here is the meta_tags.txt
index.php|title 1|meta tags|meta description
aboutus.php|title 2|meta tags|meta description
and the get_meta.php is same what you provided. In index.php i placed the same here it is:
<?php include("get_meta.php"); ?>
<?php print $title; ?>Thing is the error is undefined variable errors..
This portion is not parsing:
while($data = fgetcsv($meta_db, 9000, '|'))
{
if($data[0] == $page)
{
$title = $data[1];
$meta_keywords = $data[2];
$meta_description = $data[3];
}
}
something is wrong with the braces.. I don't know as I'm a newbie in php.