I need a script to prevent my site from being displayed on an autosurf rotator site or any other type of traffic exchange. I tried sending a redirect in the .htaccess file to a 301, but it has not worked. What can I do?
Is this code correct and will it work? <?php $d = $_SERVER['HTTP_REFERER']; if($d=="autosurf.com") { // block it } ?>
HTTP_REFERER is sent by the browser, and can be easily modified or disabled. I could guess that this rotator site won't send a referer at all, so people don't block it. However, it's worth a try: if (preg_match('/autosurf\.com/', $_SERVER['HTTP_REFERER'])) { exit(); } PHP:
Tony ... go to your browser type : g o o g l e . c o m then in the search field type : preg_match then "i'm feeeeling lucky" you will get your answer ...
Wow, I found what it means and what it does. Thanks a lot. This forum is amazing. This means a lot to me. Thank you! Now one more thing. Using vbulletin software to host a forum, how would I write this code to function in the vb templates? Or, Should this code be inserted into a file in the forum root folder?
Hello everyone! I have some great news. I found the code that I was after, tested it and it worked! Thanks a lot to all of you who helped me out. I really appreciate it.