Jump to content
Larry Ullman's Book Forums

$Page_Title


Recommended Posts

I notice in your code that when using a template format you have the header and footer code and You include the title with a variable. Is there a way to do that with the meta tags as well. Thanks

Link to comment
Share on other sites

Define the meta tags information in a variable? Depending on the meta tag and the page it's going on you will probably need some way calling the correct meta information. I store mine in a table using a series of Primary and foreign keys to retrieve them.

  • Upvote 1
Link to comment
Share on other sites

well in most of the examples in the book. for the $page_title var it will be like $page_title = "About Us" or something of that nature. I was just curious is there was a similar way to do meta info

 

becasue I wast planning on doing something like the following

 

<?php

//can something like this be done

$meta_info ="Something Something";

$page_title = 'PDFS';

include('./includes/header.html');

 

some info

 

include('./includes/header.html');

 

?>

Link to comment
Share on other sites

Sure, you can do that. You'll just need to have some PHP in your header.html that echoes that if it exists:

<html>

<head>
<title><?php if (isset ($page_title) { echo $page_title; } ?></title>
<?php if (isset ($meta_info) { echo $meta_info; } ?>
</head>

  • Upvote 1
Link to comment
Share on other sites

 Share

×
×
  • Create New...