TechGirl00 Posted August 2, 2014 Share Posted August 2, 2014 Hello group, Apologies if this has been asked. I have a site that is generating pages like this: http://www.example.com/index.php?title_page=products_info&cPath=143&products_id=001 http://www.example.com/index.php?title_page=RFEE_SaaS_Cloud_Services http://www.example.com/index.php?title_page=customer_inquiry&src=mnu I want to create dynamic meta data in the header.php ex: <title><?php echo $pageTitle; ?></title> <meta name="description" content="<?php echo $pageDescription; ?>"> I'm new to the more advanced functions of php so my question is... where are the values for $pageTitle and $pageDescription stored if every page seems to reference index.php as the page (although there might be dynamic functionality within this page I suppose)? I could understand if the pages referenced were all different like products.php, services.php, etc. I'm looking at the URLs generated on the site and am trying to figure this out. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/290236-dynamic-title-tags-headerphp/ Share on other sites More sharing options...
davidannis Posted August 2, 2014 Share Posted August 2, 2014 It is possible that the data is in a database. So, if for example we are displaying a product page the rwo in the database for the product might have fields like this: Product_name: Flying pig. Price: 9.99 Product_desc: A pig with wings. meta_desc: The only place to buy this. Not yet available. Will become available when pigs fly. keywords: OMG, Way Cool, pig, pork, feathers You first read the db, then render the page. Quote Link to comment https://forums.phpfreaks.com/topic/290236-dynamic-title-tags-headerphp/#findComment-1486680 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.