Block direct traffic

Panique

Power Member
Joined
Sep 21, 2008
Messages
708
Reaction score
473
Got some questions hope that someone could help me with this!

1] Is there a way that I could block/redirect traffic that type in my URL directly into the browser?
2] Is there a way that I can only allow traffic that comes from a specific refferer in this case Gmail?


Thanks in advance!
 
Yes it can be done..by using the basic DMR

This will block your direct traffic:
Code:
<?php

$referer = $_SERVER['HTTP_REFERER'];

if($referer == "") 

{

}

else

{

echo "<meta http-equiv="refresh" content="0;url=http://example.com/"/>";


}

?>

In the Echo statement: there must be a BACKSLASH before every double quote (") so put it in
Code:
<meta http-equiv=BACKSLASH"refreshBACKSLASH" content=BACKSLASH"0;url=http://example.com/BACKSLASH"/>
 
Thank you very much will test this and let you know :)

Do you also got the answer on question 2?
 
I think this is called the camouflage technique.
 
It doesn't work?

Code:
<?php

$referer = $_SERVER['HTTP_REFERER'];

if($referer == "") 

{

}

else

{

echo "<meta http-equiv=/"refresh/" content=/"0;url=http://example.com//"/>";


}

?>

I get a blank page
 
You have to put whatever content you want to show below the code that was supplied. Did you want the guy to build you a site too?
 
You have to put whatever content you want to show below the code that was supplied. Did you want the guy to build you a site too?

Please dont respond to increase your posts, I have content, just showing the PHP.
 
your not using backslashes... your using just a slash try it again with a backslah lol and change the www.example.com to www.google.com or soemthing

Ok now I got the site working but I doesn't block direct traffic

Code:
<?php

$referer = $_SERVER['HTTP_REFERER'];

if($referer == "") 

{

}

else

{

echo "<meta http-equiv="refresh" content="0;url=http://www.google.com"/>";
// also tried url=www.google.com


}

?>
 
As for two yes it can be done...however, the referrer has to be the same EVERY SINGLE TIME.. gmail might not work b/c the referrer is different everytime - based on what im getting from you your takling about referrers from links in peoples emails?

take the script above and instead of the

Code:
if($referer == "GMAIL.com")

change that to gmail and play around with it
 
Ok now I got the site working but I doesn't block direct traffic

Code:
<?php

$referer = $_SERVER['HTTP_REFERER'];

if($referer == "") 

{

}

else

{

echo "<meta http-equiv="refresh" content="0;url=http://www.google.com"/>";
// also tried url=www.google.com


}

?>

Direct Traffic = Blank Traffic

Code:
if($referer == "")

so this section detects the referrer...whcih is nothing..aka blank aka direct traffic..aka type in traffic

It should work lol
 
Sent you a PM with the site, thanks for all your help! :)
 
Back
Top