Archive for the 'How-tos' Category

Use HTML5 Canvas to draw and manipulate images

One of the goodies in HTML5 is it allows you to use the <canvas></canvas> tag pair to draw or manipulate images on it. But not all browsers support the HTML5 Canvas. To have a canvas displayed on your browser, you can simply have the following HTML code.

Continue reading ‘Use HTML5 Canvas to draw and manipulate images’

IP to country converter – using MaxMind GeoIP API

We’ve covered the HostIP.info API for converting the IP address to a country and city of your visitor. But you may have noticed sometime HostIP.info does not convert everything and might have comparatively lower accuracy. But if you want better accuracy, HostIP.info also recommends you to get a commercial version such as MaxMind

Continue reading ‘IP to country converter – using MaxMind GeoIP API’

How to get the country of an IP address in PHP?

The HostIP.info provides API allows you to get the country including the city as well. The simple PHP script that can get the country is as follow:

Continue reading ‘How to get the country of an IP address in PHP?’

How to print web page without prompt using JavaScript on Firefox

To print a web or HTML page without getting the usual printer prompt on your Firefox browser, you can make use of the Firefox plugin, JS Print Setup. Installation like usual installation of any Firefox plugins.

Continue reading ‘How to print web page without prompt using JavaScript on Firefox’

PHP How-to: HTTP POST without using cURL

You wanna call a remote web service using HTTP POST in your PHP, but you do not wanna use cURL as cURL might not be supported in your web host. The following codes explain how you can do it without using cURL.

Continue reading ‘PHP How-to: HTTP POST without using cURL’

Wp-syntax plugin for WordPress to automatically format or highlight syntax on programming codes in your blog posts

If you’re like me, running a blog powered by WordPress which you always need to show some programming codes in a number of languages, and you want those codes to be well-formatted with syntax highlighted while being displayed to your users. You can then make use of the WordPress’ Plugin, Wp-Syntax to do so.

Continue reading ‘Wp-syntax plugin for WordPress to automatically format or highlight syntax on programming codes in your blog posts’

How to develop desktop-like web applications ?

Uki is a JavaScript library that allows you to develop web applications to have the look and feel and interactiveness of a desktop application. You can get Uki from Ukijs.org.

Continue reading ‘How to develop desktop-like web applications ?’

How to eliminate Mixed content security warning on your web pages

Security mixed content warning
You should have been pretty familiar with the above prompt of your web browser, especially Internet Explorer, if you’ve been involved in developing web pages for your websites that are delivered via the HTTPS secure channel.

Continue reading ‘How to eliminate Mixed content security warning on your web pages’

Google Gears Geolocation API, example displays your location on Google Map

The Google Gears Geolocation API allows you to display your current position data by obtaining it from your WiFi antenna. The Google Gears Geolocation API is able to obtain the exact location of the user’s current location, in terms of latitude, longitude and even the address etc. User browsers such as Internet Explorer, Firefox must have Google Gears installed excepts Google Chrome, in order to have the Google Gears API to work on your browser.

Continue reading ‘Google Gears Geolocation API, example displays your location on Google Map’

To validate if an URL exists, use PHP CURL

PHP Curl allows you to validate if a given URL exists. What you need to do is just a simple function as follows, which takes an input URL and returns the code. If the returned code is 200, then the URL exists, else it doesn’t!

Continue reading ‘To validate if an URL exists, use PHP CURL’