Subscribe via RSS

PHP and proxy visits

Sometimes is important for you to know if your website visitor is accessing trough a proxy. One of my projects is an url shortner that gives analytics and, definitely, that is important.
When you realize that your visitor is using a proxy to hide himself and cheat the statistics, you can stop him from accessing your url or just ignore his visit on analysis… The last one is what I prefer.

Bruno Bertolini sent me a post called Block Tough Proxies and it helps me discovering who came from a proxy like hidemyass.com, in a very simple way:

<?php if(@fsockopen($_SERVER['REMOTE_ADDR'], 80, $errstr, $errno, 1))
die("Proxy access not allowed"); ?>

In the code above, the visitor can not see the site. You can change this behavior with a different logic after the if statement.

The post shows how to block with .htaccess too, but PHP is more effective in this case.

How to choose your application name

Like the Getting Real book says, give your app a name that’s easy to remember:

A big mistake a lot of people make is thinking their app’s name needs to be ultradescriptive. Don’t worry about picking a name that vividly describes your tool’s purpose; That usually just leads to a generic, forgettable name. Basecamp is a better name than something like Project Management Center or ProjectExpress. Writeboard is better than CollaborEdit.

Also, don’t focus group or committee-ize the naming process too much. Pick a name that’s short, catchy, and memorable and then run with it.

And don’t sweat it if you can’t get the exact domain name you want. You can always be creative and get close with a couple of extra letters (e.g. backpackit.com or campfirenow.com).

As usual, they are right!

But I have only one reflection to do: if your application depends on search engine results to achieve success it’s important to have a domain name that countains your keywords. This is one of the good practices on SEO (Search Engine Optimization).

Good luck!