Jump to content

[SOLVED] A Quick one for you


Wildhalf

Recommended Posts

Thank you for that

 

Just installed XAMPP and tested it it does work...

 

One last question...

 

$referrer = $_SERVER['HTTP_REFERER']; 

 

$referrer will display the whole url is there any way for extracting just the domain name from this.... What i am doing is if the url is one thing dispay one page if it's another display a different page completely

Sorted Myself.....

 

Basicaly the code below searchs the url that sent a visitor to the site and extracts the word test from it and prints it out.....

 

You can change test to what ever you want

 


<?

$referrer = $_SERVER['HTTP_REFERER']; 

//echo "$referrer";
echo $referrer;
echo '<br />';

ereg ("test", $referrer, $domain);

If ($domain[0] == 'test'){
echo 'This works </br>';
}

echo $domain[0]; // prints @example.com

?>


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.