<?php
error_reporting(0);
    if (isset($_GET['id'])){
		$idmeta2 = mysql_real_escape_string(stripslashes(strip_tags(htmlspecialchars($_GET['id'],ENT_QUOTES))));
		$dbhostsql2 = DATABASE_HOST;
		$dbusersql2 = DATABASE_USER;
		$dbpasswordsql2 = DATABASE_PASS;
		$dbnamesql2 = DATABASE_NAME;
		$connection2 = mysql_connect($dbhostsql2, $dbusersql2, $dbpasswordsql2) or die(mysql_error());
		mysql_select_db($dbnamesql2, $connection2) or die(mysql_error());
		$sql2 = mysql_query("select * from post where id_post='$idmeta2'");
		$j2 = mysql_fetch_array($sql2);
		if ($j2){
			echo "$j2[title]";
		}else{
			echo "$meta_description";
		}
    }elseif (isset($_GET['idp'])){
		$idmeta2 = mysql_real_escape_string(stripslashes(strip_tags(htmlspecialchars($_GET['idp'],ENT_QUOTES))));
		$dbhostsql2 = DATABASE_HOST;
		$dbusersql2 = DATABASE_USER;
		$dbpasswordsql2 = DATABASE_PASS;
		$dbnamesql2 = DATABASE_NAME;
		$connection2 = mysql_connect($dbhostsql2, $dbusersql2, $dbpasswordsql2) or die(mysql_error());
		mysql_select_db($dbnamesql2, $connection2) or die(mysql_error());
		$sql2 = mysql_query("select * from pages where id_pages='$idmeta2'");
		$j2 = mysql_fetch_array($sql2);
		if ($j2){
			echo "$j2[title]";
		}else{
			echo "$meta_description";
		}
    }else{
		echo "$meta_description";
    }
?>