How do I include information from a database field in index.php $title?

Ryan M

New member
My website uses cases to write the titles for pages. I can edit these through the index.php but if I want to dynamically pull information from a field on the page to give the title how would I do it?

The case normally looks like:

case "persian_rug_cleaning"; $title = "Persian Rug Cleaning";
$content_for_layout = $_GET['action'];
break;

On the page itself the name of the product is got by pulling the information from the database using:

<?php echo $rug->data['name']; ?>

But if I put this into the title ($title = "insert title here") it just shows the above characters. I'm guessing there's some sort of GET function I should be using rather than php echo but I don't know which?
 
Back
Top