What is the best way to get the content of the title tag in the URL < / P>
Actually I want to check for http_referrer and if it is present give a link back to the reference page but I would like a link to say the title of the reference page.
& lt; Page tag & gt; The reference to Tag X will not be stored anywhere in the page X. You can see & lt; Title & gt; To get the tag request the reference page.
Here is a link to some PHP code that will:
I will slightly change the code to fit your use-case:
& Lt ;? Php $ file = @ fopen ($ _ SERVER ['HTTP_REFERER'], "R") or die ("HTTP_REFERER can not open."); $ Text = fread ($ file, 16384); If ($ preg_match ('/ / title = gt; (*.) & Lt; \ / title & gt; / $, $ text, $)) {$ title = $ found [1]; } And {$ title = "- no title found -"; }? & Gt; Just keep in mind that you can not trust the HTTP_REFERER variable because browsers (or plugins etc.) can change this.
Comments
Post a Comment