Jump to content

How to return the referring page name only?


spryce

Recommended Posts

This is what I have done in past

 

$ref = $_SERVER['HTTP_REFERER'];
$ref = explode("/", $ref);
echo "$ref[2]";

 

if referer was http://www.website.com/folder then that code will output www.website.com

 

on another note it also gives you folder names

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.