Norman Posted April 22, 2010 Share Posted April 22, 2010 I'd like to put a simple box in my page which display the page title (<title></title>) and the page meta description (<meta name="description" content="<?php echo $description; ?>" />). I need this becouse I compile my header iformations based on the page itself with some variables. Do you think is this possible?Ops. I made a mistake. Read this please: http://w3schools.invisionzone.com/index.ph...st&p=169018 Link to comment Share on other sites More sharing options...
thescientist Posted April 22, 2010 Share Posted April 22, 2010 you mean with an include()? Link to comment Share on other sites More sharing options...
Norman Posted April 22, 2010 Author Share Posted April 22, 2010 Ops. I made a mistake. I have not the page dynamically completed by PHP. I was talking about another site I have and I go confused. In this site I have some pages which uses Wordpress, and some which don't. Some which uses vBulletin, etc. I'd like to add a function that uses PHP (or what else is required) to extract the current page title and the current page meta description.. Link to comment Share on other sites More sharing options...
justsomeguy Posted April 22, 2010 Share Posted April 22, 2010 The HTML is hard-coded on the page, and you want to use PHP to get the title and meta tags? Link to comment Share on other sites More sharing options...
Norman Posted April 23, 2010 Author Share Posted April 23, 2010 Sometimes it's hard-coded (wordpress, vbulletin, etc.) sometimes not (is inserted directly in the HTML with no variables). Link to comment Share on other sites More sharing options...
Norman Posted April 23, 2010 Author Share Posted April 23, 2010 I just founded this: http://webhole.net/2010/02/21/how-to-extra...ta-from-a-page/But it doesn't work. I get just this:Title:Description:Keywords: Link to comment Share on other sites More sharing options...
justsomeguy Posted April 23, 2010 Share Posted April 23, 2010 Does your server allow you to open files over HTTP? If you do this, does it work: <?phpini_set('display_errors', 1);error_reporting(E_ALL);echo file_get_contents('http://www.google.com/');?> Link to comment Share on other sites More sharing options...
Norman Posted April 23, 2010 Author Share Posted April 23, 2010 It doesn't work. "URL file-access is disabled in the server configuration". Anyway, I will ask my provider for that.Is there any other solution? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.