2008/01/14 14:13

How to block a connection from the certain site ?


Sometimes, you may need connection blocking from the link posted on the certain blog or site. In this case, you can block easilly by HTTP_REFERER.

Followings are the simple example blocking connection from foo.com posted content. But following example allows user to connect to the website directly. For instance, user can connect to http://foo.com when user put url on the browser, but in case of clicking link, the site can know where the connection comes from.

<?
  // connection blocking Example
  // Programmed 2008 by Kurapa Chunun Kang (kurapa@kurapa.com)

  if (ereg('foo.com', $_SERVER['HTTP_REFERER']))
  {
    ?><script language=javascript>self.location='http://xxx.com';</script><?
    exit;
  }
  .
  .
  .
?>
Trackback 3 Comment 0

Trackback : Cannot send a trackbact to this post.

  1. Subject different money making ideas

    Tracked from moneyideas 2010/01/29 00:15 delete

    moneyideas

  2. Subject different money making ideas

    Tracked from moneyideas 2010/01/29 08:37 delete

    moneyideas

  3. Subject different money making ideas

    Tracked from moneyideas 2010/01/31 16:43 delete

    moneyideas