Not sure if I can get all this infomation across that would be needed but... I am doing SEO on a site right now and I am to the point where I need to make the Title tags relevant. Basically doing one of these. <title>Site Name <? $product?></title> PHP: Now since the string that I need to use is no where on the .php page that would mean I guess I need to connect to the database then pull out the string I am looking for and then use it. Question is do I need this code before the <title> and could you by any chance provide me with a simple code that may work for this. I can read PHP and change it a little but I am not very good at writing it. If that makes since. Any help would be appreciated.
You should use a function that you can call with some sort of id being passed down to identify the page that is being called. Are you using PHP to build the page in the first place? There should be examples in the code of how to query it.
<?php //put code here to pull the title from db if u r using db. //you can even include another php file here and get avariable defined there. $title = row['title']; //assuming row['title'] is what u pulled out from db. ?> <html> <head> <title>Sitename <?php echo $title; ?></title> </head> <body> </body> </html> PHP: simple prototype of what u shd be doing.
Thanks, One last question. There is a .php file that has the variable in it. What would the code look like to do that? Is it just an include?
include_once("filepath/filename.php"); or just include("filepath/filename.php"); or even require("filepath/filename.php") or require_once("filepath/filename.php") instead of the includes.