Hi, I want to limit access to one of my scripts.  I have a list of web 
pages that are authorized to call my script, and I want to disable the 
script if another unauthorized page calls it.  My code to do this looks 
like the following:


      my $referer  = $ENV{HTTP_REFERER};
      my $legal_referer;
      my(@legal_referers) = ("http://www.some-url.com/page1.html";);   # 
list of authorized pages
      my $clear = 0;

      foreach $legal_referer (@legal_referers)
      {
         if ($legal_referer eq $referer)
         {  $clear = 1;  }
      }

      if (!$clear)
      {  # kill the script  }
      ...


I want to know if this is a good (safe) way to do this.  I'm open to any 
suggestions.  Thanks in advance.

Kurt

Reply via email to