Graphi Posted August 4, 2007 Share Posted August 4, 2007 http://www.phpfreaks.com/forums/index.php/topic,146406.msg626749.html#msg626749 <?php $pageid = $_GET['pid']; echo'Yes we manufacture and install Conservatories and Porches in: '.$pageid.''; ?> This script works very nicely, (please see it live - http://conservatoryandporch.com/component/option,com_wrapper/Itemid,48/) but going a little further does anyone know of a way to include $pageid into meta description, title, keywords etc. Thanks for any information. Link to comment https://forums.phpfreaks.com/topic/63257-solved-php-into-meta-tags/ Share on other sites More sharing options...
Fadion Posted August 4, 2007 Share Posted August 4, 2007 u can generate meta tags with php just as any other html tag. Write the $pageid = $_GET['pid'] before the meta tags and write them as: <meta name="keywords" content="<?php echo $pageid; ?>" /> The same involves for description and title. Link to comment https://forums.phpfreaks.com/topic/63257-solved-php-into-meta-tags/#findComment-315308 Share on other sites More sharing options...
Graphi Posted August 4, 2007 Author Share Posted August 4, 2007 <meta name="keywords" content="<?php echo $pageid; ?>" /> Thanks very much for your quick response GuiltyGear! I'll do that right now. Do I need to put the code: <?php $pageid = $_GET['pid']; ?> Between <HEAD> </HEAD> tags? Link to comment https://forums.phpfreaks.com/topic/63257-solved-php-into-meta-tags/#findComment-315311 Share on other sites More sharing options...
lightningstrike Posted August 4, 2007 Share Posted August 4, 2007 You need to put <?php $pageid = $_GET['pid']; ?> anywhere before the meta tag in the php file. Link to comment https://forums.phpfreaks.com/topic/63257-solved-php-into-meta-tags/#findComment-315312 Share on other sites More sharing options...
Graphi Posted August 4, 2007 Author Share Posted August 4, 2007 Many thanks guys! Solved lightning fast Link to comment https://forums.phpfreaks.com/topic/63257-solved-php-into-meta-tags/#findComment-315318 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.