How to Make Certificate Validator in PHP

Today I will teach you on how to make a certificate validator in PHP and deploy it in a test environment, say a local server.

What is the use of a Certificate Validator?

A certificate validator is a program used for validating the certificates. It can be used by any certificate issuing company in their websites.The script is made in such a way that it has a dual interface, one for the admin side and other for the client. The admin can add infinite no. of certificates in their database through their admin dashboard area and the clients can search and validate those certificates from the index page.

Prerequisites

Here are some prerequisites for it. So download them and get ready.
1.WAMP Server : Its an open source Apache MySQL PHP service provider for windows. Download it from here.
2. An Editor : You can use notepad for this.But I recommend a much more advanced one, say Sublime. You can download sublime from here.

Database Configuration

Now the first step is to make your database get ready.
1. Turn on your WAMP server. Just opening the WAMP application will do this.
2. Now go to any browser and type localhost/phpmyadmin in the address bar.It will open up a page like this. Now click on the New button on the left sidebar.
In the Create database tab , type cert_database and click on create.Its our database name.

3.We need to make the tables and columns ready for the database. But I have already done that for you. So you import the same for yours. Download the SQL file from here.
Select the database you created. Click on Import (See the screenshot below). It will open up a page like this.

4. Choose the SQL file you downloaded by browsing the computer and click on go.

5. You will get a similar screen and your database is ready for action.

Script Installation

Now the next step is making the files ready
1. Download the PHP script from here.
1. Navigate to c://wamp/www (I have installed WAMP in my C: drive , so I chose C://wamp/www , in your case it might be different).
2. Extract the PHP script there.
3. Now open the browser and type localhost/cert_validator/admin/

4. You are in.
5. Admin username is admin and password is 0192023a7bbd73250516f069df18b500.
6. Start adding certificates.

7. Try for validation at localhost/cert_validator.

8. View validation results.

All the best!

Know Deeper on the Codes

This section is for developers who seeks to go for deeper in the code construction.
I have used mysql_pdo database functions
You can change the configuration settings at helpersdbHelpers.php.


<?php
function dbConnect(){
try{
$username = 'root';
$password = '';
$conn = new pdo("mysql:host=localhost;dbname=accountsdb;",$username, $password);
$conn->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
return $conn;
} catch(PDOException $e){
echo 'ERROR', $e->getMessage();
}
}
?>

Rename them based on your host server configuration.

Online Certificate Validator Source Code Free Download

Download the complete certificate validator source code from here


If you got any doubts/issues regarding the installation feel free to ask it here in comments.

Add Comment