Hi, I'm creating a new website and I'm using the PHP include function with my header to reuse it on new pages. My problem is, if I use it like this on new pages: <?php include("header.php"); ?> PHP: then my title, meta description and meta keywords will be the same since those are fixed in the header.php file. So when i create a new page using the include function, how can I use title and meta data that is relevant to that page? Thanks
Hi, You need to check in header.php file to which file or page is currently running. and by using that page or file name you can set meta and description tag value to relevant page... Vishal
You can use $_SERVER['PHP_SELF'] to identify the page and then as Vishal said, you can edit meta tags accordingly, sample code snippet: if($_SERVER['PHP_SELF'] == "/index.php") echo '<meta name="SIte name" description="Hey all" >'; else if...