How to create JSON using data from MySQL database

mysql to json

JSON (JavaScript Object Notation) is more preferred nowadays over XML as it’s lightweight, readable and easily manageable for exchanging data across various platforms. Most of the social networking application apis like Facebook, twitter, geolocation service providers like google, REST-SOAP API producers and around hundreds of similar technologies/frameworks use JSON as data exchange format. While developing web applications and APIs; we ... Read More »

IMDB API implementation to get movie information

imdb api

IMDb (Internet Movie Database) is the biggest database of movie information on Internet. IMdb has over 2 million titles of movies and episodes. IMDb is a reliable source for movie information to be used for web applications related to movie and television episodes. Unfortunately IMDb has not published APIs to get the movie information programatically. But fortunately there exists a ... Read More »

Webstorage – HTML5 local offline browser storage


Modern day browsers are definitely on the verge of reducing gap between web client and the mobile. Browsers are becoming more intelligent and are offering same functionalities like native mobiles. New HTML5 attributes and functionalities; be it the geolocation, vibrator APIs or camera accessibility are helping to bridge this gap. Webstorage is among the new features provided by HTML5.  Webstorage ... Read More »

Credit Card validation regex script in PHP using Luhn algorithm

credit card regular validation expression

Credit card validation is essential for e-commerce websites. Credit card numbers entered by users will not be necessarily correct always. The credit card payment processing companies (visa,mastercard) charge merchandise for each transaction carried out. This also includes the failed transactions. Therefore it becomes essential to validate the credit card number  before sending it to the payment gateways. The unique credit ... Read More »

10 Essential $_SERVER variables PHP developer must know

PHP $_SERVER variable

$_SERVER variables provide important information about the apache web server environment. There are numerous $_SERVER variables providing different kind of information like the ip address,port number of the web server, the client browser information, document root folder of the web server etc.. In this tutorial, I have mentioned 10 most important and frequently used variables which I think every PHP ... Read More »

Gettext tutorial for Internationalization and localization of websites

gettext tutorial

To get the maximum reach of users for any website, the application strings needs to be converted in the native language of its users. Gettext is the best proven way for internationlisation (i18N) and localisation of web applications. Gettext was developed as a GNU Package for translational frameworks which was later included mostly for web application. Gettext gives the flexibility ... Read More »

Distance Formula in PHP – Calculate distance between two points

distance calculator

Calculating distance between two points or locations is the need of Social applications. While developing such applications, programmers need a code to calculate the distance between 2 points. Usually, a point on map is denoted by two co-ordinates, latitude and longitude. The following distance calculator function takes latitude and longitude of 2 points on map and returns the distance between ... Read More »

Create analog, digital clocks with CSS and JavaScript

Analog Clock CSS

Creating analog clock with CSS is no longer a tough task. New HTML5 and CSS properties have made webpages more light-weight but rich in functionality. In continuation to my previous tutorials ‘ HTML5 disc rotation animation‘ and ‘ Rotate object around its axis‘ on JavaScript; this tutorial explains ‘How to create analog clock using CSS’. Ok, Let’s start the coding ... Read More »

Rotate image, photo or object using JavaScript – Animation


With the introduction of Web 2.0; webpages are becoming more and more interactive, rich in usability, touch and gesture responsive. Animations are now invitable part of the Web and are useful in conveying the content in easy and interactive way. It also keeps users glued to the page and the website. In previous tutorial , I had explained disc rotation ... Read More »

What is SQL injection attack? How to prevent it.

sql injection attack explained

SQL injection is inserting/inputting SQL queries in the input fields of the application. SQL injection attack is one of the most widely used application vulnerability attacks. It is easy to carry out, doesn’t need detailed technical expertise and most of the sites/applications are vulnerable to it. SQL injection is considered to be the most severe attack in terms of impact. ... Read More »