Jump to content

Help Getting A Page Content


monkeybidz

Recommended Posts

I am trying to get vars to my header from whatever page I am currently viewing to print META depending on the page.

 

I have this code in header.php so far:

if($SETTINGS['keywordstag'] != '' && $SETTINGS['descriptiontag'] != '') {
    print " <META name=\"description\" content=\"".file_get_contents('')."\">";
}

 

Not sure if: file_get_contents('') is what I should be using here.

 

Can anyone help?

Link to comment
https://forums.phpfreaks.com/topic/153385-help-getting-a-page-content/
Share on other sites

I used your idea with a bit of mine:


$uri = $_SERVER["REQUEST_URI"];

if($SETTINGS['keywordstag'] != '' && $SETTINGS['descriptiontag'] != '') {
    print " <META name=\"description\" content=\"".file_get_contents('http://www.mysite.com$uri')."\">";
}

 

almost works cause now I get the URI, but just need help with the $uri directly after the .com. How would I use it there?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.