Website Tools

Website Tools

Database client library

We’ve produced a simple client library for PHP, which allows your PHP-based website to easily query the PhormCheck IP address database. It can be used in one of two modes:

  1. Caching Mode maintains a local cache of the database data, updating it only if the local data is older than a configurable age. This makes the database lookups extremely fast.
  2. Direct Query Mode will query the database every time you make a lookup. This is recommended only for low-traffic websites, or where it’s not possible for you to set the file permissions required for Caching Mode due to a restrictive web hosting provider. This is slower than Caching Mode, due to the query having to go across the internet every time.

The choice of mode is done via a config file, and the interface to the client library from your code is identical, regardless of which mode you choose.

This client library is completely free, open-source software. Note that we reserve the right to block access to the database to any client that is using excessive bandwidth in Direct Query Mode.

  • To download the phormcheck PHP library, which makes it easy for your website to query this database, click here.
  • To view some sample PHP client code for querying the database using the phormcheck PHP library, click here.
  • To view that sample PHP client code in action, click here.

Dynamic Robots.txt

Phorm claim that they will disable their system for any website that has a robots.txt file that denies spidering. However, they refuse to identify their web queries with a recognisable User Agent identifier, and instead say that they will obey whatever the Google spider is told to do.

If you wish to deny access to Phorm but not to Google, you can use our dynamic robots.txt tool so that Phorm-related clients receive a blanket ‘do not spider this site’ file when they retrieve robots.txt, but all other spiders receive your standard, more permissive version. This code uses the PhormCheck PHP client library described above.

To install the code:

  1. Install the client library as described in the README.html file in the library ZIP package.
  2. Insert the indicated lines from the code sample linked below into the start of your existing robots.txt file.
  3. Ensure that your webserver is configured to interpret the robots.txt file using PHP. For Apache with PHP5, this can be done by inserting these lines into the .htaccess file in your document root:
    • <Files robots.txt>
    •   SetHandler php5-script
    • </Files>

You can use the ‘test’ parameter to check whether the code is working as expected. Just add ‘?test=1.2.3.4′ to the end of your query to retrieve robots.txt, replacing ’1.2.3.4′ with the IP address you’d like to simulate a request from.

  • To see the sample dynamic robots.txt code, click here.
  • To see how that robots.txt looks for Phorm-related IP addresses, click here
  • To see how that robots.txt looks for your IP address, click here

Dynamic Warning Banner

The client library described above comes with a handy function to allow you to display a warning banner image on your site if your visitor is coming from a suspicious IP address. Plus, you can display an alternative banner (or nothing at all) if the visitor is coming from a clean address.

The library comes with a sample banner image:
You are being spied on by your ISP
but you can easily configure it to use any image you like, so long as it can be served over the web.

  • To see some sample code to display the banner, click here.
  • To see how that code looks for Phorm-related IP addresses, click here
  • To see how that code looks for your IP address, click here.

Cookie Interference Tester

Another feature of the client library is a simple, server-side-only test that can be used to detect whether a given client of your website is currently afflicted with DPI spyware, by observing some subtle side-effects of the UID cookies used by most known DPI spyware systems.

See the README.html file in the library package to see how to use the phormcheck_check_cookies() function.

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!