pcbytes Posted April 9, 2007 Share Posted April 9, 2007 I can't seem to get the dynamic meta tags to work on my site. I am loading a remote page into index.php, and the $meta variable on the remote page has the description I want to load into index.php index.php meta tag. <meta name="description" content="<?php $_GET[$meta]; ?>"> index.php dynamic page load <?php $page = $_GET['page']; urlencode($page); if($page > "") { include($page); } Else //if page just loads and no "page=" variable set show main page { include('dynamic_page'); } ?> remote file being dynamically loaded <?php $meta = "An informative article about food"; ?> <h1> bla bla bla content here bla bla bla</h1> Link to comment https://forums.phpfreaks.com/topic/46203-dynamic-meta-tags/ Share on other sites More sharing options...
TheFilmGod Posted April 9, 2007 Share Posted April 9, 2007 I'm not exactly sure what you want to do but I have dynamic meta tags and it works for me. <html> <?php include('meta.php') ?> <body> blah blah </body> </html> Now make the meta.php file to be in the same file directory (or change that) and have it read this: <head> <title> Page Title </title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="description" content="Description of page here"> <meta name="keywords" content="Keywords here"> </head> It works for me. Link to comment https://forums.phpfreaks.com/topic/46203-dynamic-meta-tags/#findComment-224612 Share on other sites More sharing options...
pcbytes Posted April 9, 2007 Author Share Posted April 9, 2007 yeah the file that im loading though is not a full html file. its just content. It doesnt include any head, title, or body tags. all that is done on the static index.php page. Link to comment https://forums.phpfreaks.com/topic/46203-dynamic-meta-tags/#findComment-224614 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.