Hello, it's me again...
I managed to do what I wanted but I still have a very little problem.
Connorhd proposed to put that code
$ip=$_SERVER['REMOTE_ADDR'];
if (@$_SERVER["HTTP_X_FORWARDED_FOR"])
$ip=$_SERVER["HTTP_X_FORWARDED_FOR"];
$sCookieValue=md5($_SERVER['HTTP_HOST'].$ip);
if (!isset($_COOKIE['DAlbum_Connection']) ||
$_COOKIE['DAlbum_Connection']!=$sCookieValue)
{
// Check referrer. If referrer is our domain -
// allow access even if cookie is not set
if (isset($_SERVER['HTTP_REFERER']))
{
$ref=parse_url($_SERVER['HTTP_REFERER']);
$sHost=basename($ref['host'] );
if (isset($_SERVER['HTTP_HOST']) &&
strcasecmp($_SERVER['HTTP_HOST'],$sHost)==0)
return;
}
exit("404 Not found");
}
So people arrive on a page where is written "404 Not found"
I can change this to set a redirect link to my website with this
exit('<a href="http://www.mywebsite.com/index.php" target="_blank">mywebsite.com</a>') ;
But I don't know how to write a little sentence just before the link.
I'm able to put the link or to write a sentence, but not both together.
So can someone help me to change the "exit code" in order to have something like :
"You should go to my www.mywebsite.com prior to access to this page"
Thanks to all.