Pincode database of india with location finder script in php and jquery

In this post i am going to give you a very useful script and database for your projects, Every body needs this when people worked on any shipping based projects and other postal based projects.

So here i’ll show you how to create a very simple location finder script by pincode using php, jquery and mysql.
pin




You can also download pincode/zipcode/postcode database of india free from here.

DEMO DOWNLOAD

Lets start the tutorial.

Create database and table.

CREATE TABLE IF NOT EXISTS `pincodes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `pincode` varchar(50) DEFAULT NULL,
  `divisionname` varchar(100) DEFAULT NULL,
  `egionname` varchar(100) DEFAULT NULL,
  `circlename` varchar(100) DEFAULT NULL,
  `taluk` varchar(100) DEFAULT NULL,
  `districtname` varchar(100) DEFAULT NULL,
  `statename` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1;



Create a html file where you’ll put all your ui level code.
Here i used jquery-ui auto-complete plugin, You can refer this tutorial to creating auto-complete/auto-suggest feature for your website : http://www.iamrohit.in/simple-auto-suggest-example-using-php-jquery-and-mysql/

index.html




  
  Simple location locator by pincode
  
 




Find location by entering pincode


Enter at least 3 digit to show auto-complete.
Taluka:
Division Name:
Region Name:
Circle Name:
State Name:

Now time to create server file which will fetch pincode data from your mysql database and give you desired output you can modify this file according to your need.

request.php


Your directory structure will be

+--img
---index.php
---request.php

If you have done all the steps successfully just hit the url on browser and see the demo.

DEMO DOWNLOAD

If you like this post please don’t forget to subscribe My Public Notebook for more useful stuff.