Archive for January, 2010
How to get visitor’s browser and operating system?
User Agent string is a characteristic identification text which is submitted by web browsers, bots and other applications which use World Wide Web.
In PHP you can get this from $_SERVER['HTTP_USER_AGENT'] variable.
Using this variable you cannot identify a web browser with 100% accuracy as this string might be quite easily altered by a web browser user. Hoewever modifying UAS is not something most people do
Where to get free icons, photos, logos?
In this post you will find a bunch of links to sites with free icons, photos and logos.
Telesign – phone/sms verification class for PHP
Ever wanted to limit your users to have 1 account? Ever wanted to stop bots from registering on your site?
Here’s a nice solution- a PHP class to use Telesign phone verification service.
How does it work? You simply “ask” this class to generate an unique number, let’s say 5 digits long.
Then you send this digits to your user’s phone via SMS or as a phone call (automated message will be played to your user).
Open Calais- tag your content automatically
Open Calais is a free to use web service which tags submitted content. On their website you can find some code examples, but they are a bit primitive. Here’s a very handy PHP class you can use for free.
Wordpress plugin- Youtube embedder
Here’s my next Wordpress plugin. This one lets you embed a youtube video on your blog easily. You don’t have to use embed html code anymore. Just write:
[ youtube http://www.youtube.com/watch?v=AABBCCDDEEFF 300 200]
Youtube- embed and get screen shot
I created this class, because I needed a simple way to get video screen shots and embed link from normal youtube link ( http://www.youtube.com/watch?v=AABBCCDDEEFF ). Embed link is a link you can put in
Ip To Country detection
First grab Geo Lite Country database from Max Mind website. Then grab a small PHP class.
When you have those just write a few lines of code to display country of any visitor of your site.
How to detect user’s country/language – the simple way
To detect user’s language we need a table of language codes and the $_SERVER['HTTP_ACCEPT_LANGUAGE'] variable.
How to detect visitor’s country using his IP address
Software77 is perhaps the first company which created IP to country database. On their website you can grab the DB in CSV and GeoIP format with a few example scripts in various languages to use the DB. I couldn’t find anything in PHP to operate on their GeoIP format DB, so I converted the CSV version to PHP arrays and created a simple script to handle this new format.
Headers using any font- image header PHP generator
If you got a fancy layout to cut, but the graphic designer used some non-standard fonts, you have to same same headers as images. In many cases you can just make the image headers in your favourite graphic editor, but what if your headers need to change dynamically (e.g. must be editable via some control panel)?
