Online or Offline Address Book

The address book is an essential part of our life since centuries. With digital evolution, these books are replaced with software and when the smartphone came, the first thing they added into their system are contacts alias Address books. 

In this article, we will learn how we can develop a simple address book in PHP, HTML, and MySQL. Also at the end of this article, I have added download links for other programming languages such as VB, Java and .Net. 

For the PHP Application, the first thing we will need to do is to create a basic form to get the information from the User.

The information would be like the First Name, Last Name, Mobile, Phone and Address

And to store this information on the backend, we will create a database address books with one table called contacts. 

This table will have columns like id, first_name, last_name, mobile, phone and address where id is our primary key and needs to be autoincremented.

Create Database with the name of AddressBooks. I am doing it using PHPMyAdmin but you can do it directly using MySQL terminal or using MySQL WorkBench.

Create Table with the name contacts having 5 fields. Just make sure to set id as Primary key and check auto Increment option.








Step 1) In your webserver root folder, create a new folder with the name of addressbooks

Step 2) Create an index.php file inside this folder and open it to your favorite editor. I prefer Sublime text but you can choose any one of your choice

Step 3) Copy the HTML Boilderplate from this site and paste it inside the index.php file we created in Step 2. 

Step 4) Create HTML Form:

<!DOCTYPE html>
<title>Add Contact Form</title>
<inputtype="text"class="form-control"id="firstName"placeholder="First Name">
<inputtype="text"class="form-control col-sm"id="lastName"placeholder="Last Name">
<labelfor="exampleInputEmail1">Email address</label>
<inputtype="email"class="form-control"id="exampleInputEmail1"aria-describedby="emailHelp"placeholder="Enter email">
<smallid="emailHelp"class="form-text text-muted">We'll never share your email with anyone else.</small>
<buttontype="submit"class="btn btn-primary">Submit</button>
<script src="" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script src="" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>

Step 5) Post this form on the backend

Step 6) Fetch the values in the backend

Step 7) Store values into the database

Step 8) Create New page to show all this values

Step 9) Pagination 

submit.php file

   $connection = mysqli_connect("localhost","root","root","addressbook");
   if (mysqli_connect_errno()) {
      echo "Failed to connect to MySQL: " . mysqli_connect_error();
   	if(isset($_POST['first_name'])) {

   		$first_name = $_POST['first_name'];
   		$last_name = $_POST['last_name'];
   		$phone = $_POST['phone'];
   		$address = $_POST['address'];
   		$insert_sql = "INSERT INTO contacts 
   					   (first_name, last_name, phone,address)
				VALUES('$first_name', '$last_name', '$phone', '$address');";
		 $result = mysqli_query($connection, $insert_sql);
		 	echo "Succesfully Added <br /><hr /><br /><br />";
         $sql = 'SELECT * FROM contacts';
         $result = mysqli_query($connection, $sql);
         if (mysqli_num_rows($result) > 0) {
            while($row = mysqli_fetch_assoc($result)) {
               echo "Name: " . $row["first_name"].' '.$row["last_name"]. "<br>";
                echo "Phone: " . $row["phone"]. "<br>";
                echo "Address: " . $row["address"]. "<br>";
                echo "<hr />";
         } else {
            echo "0 results";

This will be great project if you can build good and optimized address book software for Mobile software with reminder. If you want you can develop online application having latest features such as reminding using emails and sms.This project will sharpen your concept and develop your business sense.

Download Source Code of PHP Address Book

Download Java Swing Address book

VB 6 Address Book

VB 2005 Address Book and Event Reminder

Dot Net Application with source code in C#

JContact is an online address book management application. It is web
based J2EE application build on JSF, Spring and Hibernate. The web2.0
framework Rich Faces makes the application more interactive.

Address book reloaded This is a PHP addressbook web application to store contact
details of employees/customers in utf8 format on an intranet or website;
features Google Maps, distributed management, PDF address books,
plugins, styles. DEMO:

Online Address Book (OAB) is an open source PHP web application designed
for persistant, web-based storage of contact information. It provides a
flexible and convenient interface, and supports importing and exporting

Comments >>