Showing posts with label mysql. Show all posts
Showing posts with label mysql. Show all posts

Friday, 20 November 2015

Multistep Registration Form Using PHP

Sometimes we required to capture lots of user details during registration. Due to this we got long forms on our website. So the best solution is to break into smaller logical section and convert it into a multi step form. This type of mult step form always improves usability on our site comparing very long form. Now we are going to explain how to convert very long form into multi-step signup form using PHP, MySQLi / PDO and jQuery.

 

NOTE: password_verify() required PHP version >=5.5. So use another hashing if your server don’t have PHP version 5.5 or greater.
You can use another password encryption and decryption method if you have PHP version < 5.5.

Database SQL Script:


CREATE TABLE `users` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`name` VARCHAR(100) NULL DEFAULT NULL,
`password` VARCHAR(72) NULL DEFAULT NULL,
`email` VARCHAR(100) NULL DEFAULT NULL,
`gender` VARCHAR(6) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB;

Database Connection: (db_connection.php)
<?php
    define('_HOST_NAME', 'localhost');
    define('_DATABASE_USER_NAME', 'root');
    define('_DATABASE_PASSWORD', '');
    define('_DATABASE_NAME', 'demo');
 
    $dbConnection = new mysqli(_HOST_NAME, _DATABASE_USER_NAME, _DATABASE_PASSWORD,
 _DATABASE_NAME);
    if ($dbConnection->connect_error) {
        trigger_error('Connection Failed: '  . 
$dbConnection->connect_error, E_USER_ERROR);
     }

index.php
<?php
    include 'db_connection.php'; 
    if(isset($_POST['finish'])){
      $name = '"'.$dbConnection->real_escape_string($_POST['name']).'"';
     $email = '"'.$dbConnection->real_escape_string($_POST['email']).'"';
     $password = '"'.password_hash($dbConnection->real_escape_string($_POST['password'])
, PASSWORD_DEFAULT).'"';
        $gender = '"'.$dbConnection->real_escape_string($_POST['gender']).'"';
  
        $sqlInsertUser = $dbConnection->query("INSERT INTO users (name, password, email,
 gender) VALUES($name, $password, $email, $gender)");
 
        if($sqlInsertUser === false){
        trigger_error('Error: ' . $dbConnection->error, E_USER_ERROR);
        }else{
            echo 'Last inserted record is : ' .$dbConnection->insert_id ; 
        }
    }
?>
<html>
<head>
<title>Multi step registration form PHP, JQuery, MySQLi</title>

<style>
body{font-family:tahoma;font-size:12px;}
#signup-step{margin:auto;padding:0;width:53%}
#signup-step li{list-style:none; float:left;padding:5px 10px;
border-top:#004C9C 1px solid;border-left:#004C9C 1px solid;
border-right:#004C9C 1px solid;border-radius:5px 5px 0 0;}
.active{color:#FFF;}
#signup-step li.active{background-color:#004C9C;}
#signup-form{clear:both;border:1px #004C9C solid;padding:20px;width:50%;margin:auto;}
.demoInputBox{padding: 10px;border: #CDCDCD 1px solid;border-radius: 4px;
background-color: #FFF;width: 50%;}
.signup-error{color:#FF0000; padding-left:15px;}
.message {color: #00FF00;font-weight: bold;width: 100%;padding: 10;}
.btnAction{padding: 5px 10px;background-color: #F00;border: 0;color: #FFF;cursor: 
pointer; margin-top:15px;}
label{line-height:35px;}
</style>
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script>

function validate() {
    var output = true;
    $(".signup-error").html('');
    if($("#personal-field").css('display') != 'none') {
        if(!($("#name").val())) {
            output = false;
            $("#name-error").html("Name required!");
        }
        if(!($("#email").val())) {
            output = false;
            $("#email-error").html("Email required!");
        }
        /** Remove below Comment for email validation **/ 
        /*if(!$("#email").val().match(/^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/)) {
            $("#email-error").html("Invalid Email!");
            output = false;
        }*/
    }

    if($("#password-field").css('display') != 'none') {
        if(!($("#user-password").val())) {
            output = false;
            $("#password-error").html("Password required!");
        } 
        if(!($("#confirm-password").val())) {
            output = false;
            $("#confirm-password-error").html("Confirm password required!");
        } 
        if($("#user-password").val() != $("#confirm-password").val()) {
            output = false;
            $("#confirm-password-error").html("Password not matched!");
        } 
    }
    return output;
}

$(document).ready(function() {
    $("#next").click(function(){
        var output = validate();
        if(output) {
            var current = $(".active");
            var next = $(".active").next("li");
                if(next.length>0) {
                    $("#"+current.attr("id")+"-field").hide();
                    $("#"+next.attr("id")+"-field").show();
                    $("#back").show();
                    $("#finish").hide();
                    $(".active").removeClass("active");
                    next.addClass("active");
                    if($(".active").attr("id") == $("li").last().attr("id")) {
                        $("#next").hide();
                        $("#finish").show();    
                    }
                }
            }
        });
    $("#back").click(function(){ 
        var current = $(".active");
        var prev = $(".active").prev("li");
        if(prev.length>0) {
            $("#"+current.attr("id")+"-field").hide();
            $("#"+prev.attr("id")+"-field").show();
            $("#next").show();
            $("#finish").hide();
            $(".active").removeClass("active");
            prev.addClass("active");
            if($(".active").attr("id") == $("li").first().attr("id")) {
                $("#back").hide();   
            }
        }
    });
});
</script>
</head>
<body>
<ul id="signup-step">
    <li id="personal" class="active">Personal Detail</li>
    <li id="password">Password</li>
    <li id="general">General</li>
</ul>
<form name="frmRegistration" id="signup-form" method="post">
    <div id="personal-field">
        <label>Name</label><span id="name-error" class="signup-error"></span>
        <div><input type="text" name="name" id="name" class="demoInputBox"/></div>
        <label>Email</label><span id="email-error" class="signup-error"></span>
        <div><input type="text" name="email" id="email" class="demoInputBox" /></div>
    </div>
        <div id="password-field" style="display:none;">
            <label>Enter Password</label><span id="password-error" class="signup-error">
</span>
            <div><input type="password" name="password" id="user-password" 
class="demoInputBox" /></div>
            <label>Re-enter Password</label><span id="confirm-password-error" 
class="signup-error"></span>
            <div><input type="password" name="confirm-password" id="confirm-password" 
class="demoInputBox" /></div>
        </div>
        <div id="general-field" style="display:none;">
            <label>Gender</label>
            <div>
                <select name="gender" id="gender" class="demoInputBox">
                    <option value="female">Female</option>
                    <option value="male">Male</option>
                </select>
            </div>
        </div>
    <div>
        <input class="btnAction" type="button" name="back" id="back" value="Back"
 style="display:none;">
        <input class="btnAction" type="button" name="next" id="next" value="Next" >
        <input class="btnAction" type="submit" name="finish" id="finish" value="Finish" 
style="display:none;">
    </div>
</form>
</body>
</html>


If you have any problem regarding this tutorial configuration please feel free to comment we love to answer your queries.

Friday, 21 August 2015

How To Create Parent Child Category Tree Using PHP & MySQLi

In this tutorial we are going to explain how to create nth level category tree using PHP and MySQLi. We have write a very simple php function and call recursivily.

 

First we have created a database table with parent child mapping of categories:


 CREATE TABLE `tbl_categories` (
   `id` INT(11) NOT NULL AUTO_INCREMENT,
   `name` VARCHAR(100) NOT NULL DEFAULT '0',
   `parent_id` INT(11) NOT NULL DEFAULT '0',
   PRIMARY KEY (`id`)
 )
 ENGINE=InnoDB;
 

 Insert dummy categories:

 
 INSERT INTO `tbl_categories` (`id`, `name`, `parent_id`) VALUES
(1, 'Hardware', 0),
(2, 'Software', 0),
(3, 'Movies', 0),
(4, 'Clothes', 0),
(5, 'Printers', 1),
(6, 'Monitors', 1),
(7, 'Inkjet printers', 5),
(8, 'Laserjet Printers', 5),
(9, 'LCD monitors', 6),
(10, 'TFT monitors', 6),
(11, 'Antivirus', 2),
(12, 'Action movies', 3),
(13, 'Comedy Movies', 3),
(14, 'Romantic movie', 3),
(15, 'Thriller Movies', 3),
(16, 'Mens', 4),
(17, 'Womens', 4),
(18, 'Shirts', 16),
(19, 'T-shirts', 16),
(20, 'Shirts', 16),
(21, 'Jeans', 16),
(22, 'Accessories', 16),
(23, 'Tees', 17),
(24, 'Skirts', 17),
(25, 'Leggins', 17),
(26, 'Jeans', 17),
(27, 'Accessories', 17),
(28, 'Watches', 22),
(29, 'Tie', 22),
(30, 'cufflinks', 22),
(31, 'Earrings', 27),
(32, 'Bracelets', 27),
(33, 'Necklaces', 27),
(34, 'Pendants', 27);
 

Category Parent Child Tree Function:

 <?php
function categoryParentChildTree($parent = 0, $spacing = '', $category_tree_array = '') {
    global $dbConnection;
    $parent = $dbConnection->real_escape_string($parent);
    if (!is_array($category_tree_array))
        $category_tree_array = array();

    $sqlCategory = "SELECT id,name,parent_id FROM tbl_categories WHERE parent_id = $parent ORDER BY id ASC";
    $resCategory=$dbConnection->query($sqlCategory);
   
    if ($resCategory->num_rows > 0) {
        while($rowCategories = $resCategory->fetch_assoc()) {
            $category_tree_array[] = array("id" => $rowCategories['id'], "name" => $spacing . $rowCategories['name']);
            $category_tree_array = categoryParentChildTree($rowCategories['id'], '&nbsp;&nbsp;&nbsp;&nbsp;'.$spacing . '-&nbsp;', $category_tree_array);
        }
    }
    return $category_tree_array;
}  ?>

 index.php

<?php
    require_once 'db_connection.php';
    require_once 'functions.php';
   
    $categoryList = categoryParentChildTree();
    foreach($categoryList as $key => $value){
        echo $value['name'].'<br>';
    }  ?>
 

 If you have any problem regarding this tutorial configuration please feel free to comment we love to answer your queries.

Autocomplete search using php, mysql and ajax

We know what is autocomplete in input type, that is make some predefined entered texts come under the input type box, while focusing on the input type, similarly we are searching some content from mysql database, this actually see image style search concept to suggest some data for select before we get the exact search, for that we are using this kind of search, and this is very simple to make search in php, mysql with ajax and jquery. let see it in brief.

 

as like you see in the above image, the search will be comes like that by using php, mysql and ajax with jquery.

DATABASE DETAILS

database name-->phpmvcbug

table name --> autocomplete

column names --> id, name, email


DB.PHP
<?php
$connection = mysql_connect('localhost','root','') or die(mysql_error());
$database = mysql_select_db('phpmvcbug') or die(mysql_error());
?>

the above is database file.

INDEX.PHP
<div class="content">
<input type="text" class="search" id="searchid" placeholder="Search for people" /> 
 Ex:arunkumar, shanmu, vicky<br /> 
<div id="result"></div>
</div>

just give this input type only in index page with AJAX. you can see the ajax coding below here that is also comes in index page


AJAX
<script type="text/javascript" src="jquery-1.8.0.min.js"></script>
<script type="text/javascript">
$(function(){
$(".search").keyup(function() 
{ 
var searchid = $(this).val();
var dataString = 'search='+ searchid;
if(searchid!='')
{
    $.ajax({
    type: "POST",
    url: "search.php",
    data: dataString,
    cache: false,
    success: function(html)
    {
    $("#result").html(html).show();
    }
    });
}return false;    
});

jQuery("#result").live("click",function(e){ 
    var $clicked = $(e.target);
    var $name = $clicked.find('.name').html();
    var decoded = $("<div/>").html($name).text();
    $('#searchid').val(decoded);
});
jQuery(document).live("click", function(e) { 
    var $clicked = $(e.target);
    if (! $clicked.hasClass("search")){
    jQuery("#result").fadeOut(); 
    }
});
$('#searchid').click(function(){
    jQuery("#result").fadeIn();
});
});
</script>

the above all for make action in SEARCH page with out refreshing the page.


SEARCH.PHP
<?php
include('db.php');
if($_POST)
{
$q=$_POST['search'];
$sql_res=mysql_query("select id,name,email from autocomplete where name 
                      like '%$q%' or email like '%$q%' order by id LIMIT 5");
while($row=mysql_fetch_array($sql_res))
{
$username=$row['name'];
$email=$row['email'];
$b_username='<strong>'.$q.'</strong>';
$b_email='<strong>'.$q.'</strong>';
$final_username = str_ireplace($q, $b_username, $username);
$final_email = str_ireplace($q, $b_email, $email);
?>
<div class="show" align="left">
<img src="author.PNG" style="width:50px; height:50px; float:left; margin-right:6px;" />
 <span class="name"><?php echo $final_username; ?></span>&nbsp;<br/> 
<?php echo $final_email; ?><br/>
</div>
<?php
}
}
?>

that's it. as like the usual fetch from database with like and here we are just adding str_ireplace, that's it. and other thinks are as like we know, that is very simple one. let's try this. and each of our entering text that wil comes as in strong letter.

 

If you have any problem regarding this tutorial configuration please feel free to comment we love to answer your queries.

File download coding using PHP and Mysql

File downloading code is the method of downloading a file from the database, how to download a file from the database, usually uploaded file are stored in the database and how we can download it. let see, using PHP code we going to download the file. so here we must have to know the upload coding. here i'm not showing upload code, here i just show you and explain you the downloading code only.

 here my database field details are,

Database name --> phpmvcbug
table name --> upload
column names --> id, name, type (3 columns)

the above is database structure.

DB.PHP

<?php
$conn=mysql_connect("localhost","root","") or die(mysql_error());
$db=mysql_select_db("phpmvcbug",$conn);
?>

INDEX.PHP

<?php 
    include("db.php");  
    $fetc = "SELECT * FROM upload LIMIT 5";
    $result = mysql_query($fetc);
?>
<body>
<?php
while($row1=mysql_fetch_array($result))
{
    $name=$row1['name'];
    $type=$row1['type'];
    ?>
<div class="rect">
<img alt="down-icon" src="down-drop-icon.png" align="left" width="20" height="20" />
<a href="download.php?filename=<?php echo $name ;?>" >
<?php echo $name ;?></a>
</div>
<?php 
} 
?>
</body>

select * from upload table limit to show only 5 data s. and the variable $result is fetched as array in while and echo the file name. for that file name we are giving the download link, that is from download.php.


DOWNLOAD.PHP

<?php
function output_file($file, $name, $mime_type='')
{
 if(!is_readable($file)) die('File not found or inaccessible!');
 $size = filesize($file);
 $name = rawurldecode($name);
 $known_mime_types=array(
    "htm" => "text/html",
    "exe" => "application/octet-stream",
    "zip" => "application/zip",
    "doc" => "application/msword",
    "jpg" => "image/jpg",
    "php" => "text/plain",
    "xls" => "application/vnd.ms-excel",
    "ppt" => "application/vnd.ms-powerpoint",
    "gif" => "image/gif",
    "pdf" => "application/pdf",
    "txt" => "text/plain",
    "html"=> "text/html",
    "png" => "image/png",
    "jpeg"=> "image/jpg"
 );
 
 if($mime_type==''){
     $file_extension = strtolower(substr(strrchr($file,"."),1));
     if(array_key_exists($file_extension, $known_mime_types)){
        $mime_type=$known_mime_types[$file_extension];
     } else {
        $mime_type="application/force-download";
     };
 };
 
 //turn off output buffering to decrease cpu usage
 @ob_end_clean(); 
 
 // required for IE, otherwise Content-Disposition may be ignored
 if(ini_get('zlib.output_compression'))
 ini_set('zlib.output_compression', 'Off');
 header('Content-Type: ' . $mime_type);
 header('Content-Disposition: attachment; filename="'.$name.'"');
 header("Content-Transfer-Encoding: binary");
 header('Accept-Ranges: bytes');
 
 // multipart-download and download resuming support
 if(isset($_SERVER['HTTP_RANGE']))
 {
    list($a, $range) = explode("=",$_SERVER['HTTP_RANGE'],2);
    list($range) = explode(",",$range,2);
    list($range, $range_end) = explode("-", $range);
    $range=intval($range);
    if(!$range_end) {
        $range_end=$size-1;
    } else {
        $range_end=intval($range_end);
    }

    $new_length = $range_end-$range+1;
    header("HTTP/1.1 206 Partial Content");
    header("Content-Length: $new_length");
    header("Content-Range: bytes $range-$range_end/$size");
 } else {
    $new_length=$size;
    header("Content-Length: ".$size);
 }
 
 /* Will output the file itself */
 $chunksize = 1*(1024*1024); //you may want to change this
 $bytes_send = 0;
 if ($file = fopen($file, 'r'))
 {
    if(isset($_SERVER['HTTP_RANGE']))
    fseek($file, $range);
 
    while(!feof($file) && 
        (!connection_aborted()) && 
        ($bytes_send<$new_length)
          )
    {
        $buffer = fread($file, $chunksize);
        echo($buffer); 
        flush();
        $bytes_send += strlen($buffer);
    }
 fclose($file);
 } else
 //If no permissiion
 die('Error - can not open file.');
 //die
die();
}
//Set the time out
set_time_limit(0);

//path to the file
$file_path='files/'.$_REQUEST['filename'];


//Call the download function with file path,file name and file type
output_file($file_path, ''.$_REQUEST['filename'].'', 'text/plain');
?>

look at the highlighted part in the above coding. from the folder name files the files are already stored and we are retrieving that.

types as store in Database


    "htm" => "text/html",
    "exe" => "application/octet-stream",
    "zip" => "application/zip",
    "doc" => "application/msword",
    "jpg" => "image/jpg",
    "php" => "text/plain",
    "xls" => "application/vnd.ms-excel",
    "ppt" => "application/vnd.ms-powerpoint",
    "gif" => "image/gif",
    "pdf" => "application/pdf",
    "txt" => "text/plain",
    "html"=> "text/html",
    "png" => "image/png",
    "jpeg"=> "image/jpg"

if the file name is extended with above all extensions. the type stored in database must by like that the above. that is important.

 

If you have any problem regarding this tutorial configuration please feel free to comment we love to answer your queries.

Thursday, 20 August 2015

Comment System using PHP and MySql

Here we are going to see about comment system suing PHP and MySql, here it is useful to all webpage feedback system like user comments Displays at the end of all WebPages that’s what we are going to see here.

 

The above is Sample output image,  so here we are going to create a database with values, they are like 


DATABASE

database name --> downdropcomment
table name --> commenttable
table values --> name--> varchar(20)
job --> varchar (25)
message --> varchar (250)

the above is database format

  CODE
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Comment system using php and mysql</title>
</head>
<body>
<form name="comment" method="post" action="comment.php" onSubmit="return validation()">
<table width="500" border="0" cellspacing="3" cellpadding="3" style="margin:auto;">
  <tr>
    <td align="right" id="one">Name :<span style="color:#F00;">*</span></td>
    <td><input type="text" name="namename" id="tnameid"></td>
  </tr>
  <tr>
    <td align="right" id="one">Work :<span style="color:#F00;">*</span></td>
    <td><input type="text" name="job" id="tjobid"></td>
  </tr>
  <tr>
    <td align="right" id="one"></td>
    <td><textarea name="message" id="tmessageid"></textarea></td>
  </tr>
  <tr>
  <td align="right" id="one"></td>
  <td><input type="submit" name="submit" id="submit" value="Submit Comment"></td>
  </tr>
</table>
</form>
</body>
</html>


FORM IMAGE



And then have to create a comment insert code. 

<?php
include("db.php");
if(isset($_POST['submit']))
{
 $name=$_POST['namename'];
 $job=$_POST['job'];
 $message=$_POST['message'];
 $insert=mysql_query("insert into commenttable
                (name,job,message)values
                ('$name','$job','$message')")or die(mysql_error());
 header("Location:index.php");
 }
?>


And then display the comment.

<?php
include("db.php");
$select=mysql_query("select * from commenttable");
while($row=mysql_fetch_array($select))
{
 echo "<div id='sty'>";
 echo "<img src='files/fav icon.png'"."' width='50px' 
                                                height='50px' 
                                                align='left' />";
 echo "<div id='nameid'>".$row['name']."</div>";
 echo "<div id='msgid'>".$row['message']."</div>";
 echo "</div><br />";
}
?>

OUTPUT IMAGE

that's it comment system is ready.

If you have any problem regarding this tutorial configuration please feel free to comment we love to answer your queries.

Simple Pagination with loading effect using Qjuery, PHP and MySql

Simple Pagination is the matter of showing limited data in a particular page, here i'm using Jquery, php, mysql. if we have more number of data in a single page, we just make it to show a particular data in a page. for that we are using this pagination. just know how the pagination works and know some of the details about pagination and how to make it without page refreshing, let see the tutorial.

 

 in this pagination system, we just use three things Jquery,PHP, and mysql database, and here we see what are all needed for this pagination system.

  1. index.php

  2. pagination.php

  3. db.php

  4. indexscript

  5. Jquery.min.js

    the above all files are needed to run this pagination. 
    database name -->phpmvcbug
    table name --> pagination
    column names --> id, name, designation, place

    DB.PHP

    <?php
    $mysql_hostname = "localhost";
    $mysql_user = "root";
    $mysql_password = "";
    $mysql_database = "phpmvcbug";
    $con = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("Opps some thing went wrong");
    mysql_select_db($mysql_database, $con) or die("Opps some thing went wrong");
    ?>
    

    PAGINATION.PHP

    include the database file, and assign the number of data have to view in the page. then follow the below code.
    <?php
    include('db.php');
    $per_page = 4; 
    if($_GET)
    {
    $page=$_GET['page'];
    }
    $start = ($page-1)*$per_page;
    $select_table = "select * from pagination order by id limit $start,$per_page";
    $variable = mysql_query($select_table);
    ?>
        <table width="800px">
            <?php
            $i=1;
            while($row = mysql_fetch_array($variable))
            {
                $name=$row['name'];
                $design=$row['designation'];
                $place=$row['place'];
            ?>
            <tr>
            <td style="color:#999;"><?php echo $i++; ?></td>
            <td><?php echo $name; ?></td>
            <td><?php echo $design; ?></td>
            <td><?php echo $place; ?></td></tr>
            <?php
            }
            ?>
    </table>
    

    SCRIPT

    the script is comes under in the page of index or where you need it. just call the script with as what have you assigned in the page, make it for as the coding is given by you.
    <script type="text/javascript" src="jquery.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
        function Display_Load()
        {
            $("#load").fadeIn(1000,0);
            $("#load").html("<img src='load.gif' />");
        }
        function Hide_Load()
        {
            $("#load").fadeOut('slow');
        };
        $("#paginate li:first").css({'color' : '#FF0084'}).css({'border' : 'none'});
        Display_Load();
        $("#content").load("pagination.php?page=1", Hide_Load());
        $("#paginate li").click(function(){
            Display_Load();
            $("#paginate li")
            .css({'border' : 'solid #193d81 1px'})
            .css({'color' : '#0063DC'});
            $(this)
            .css({'color' : '#FF0084'})
            .css({'border' : 'none'});
            var pageNum = this.id;
            $("#content").load("pagination.php?page=" + pageNum, Hide_Load());
        });
    });
    </script>

    INDEX.PHP

    first add the database file, and assign the number, how many data have to view in page. then select the table to fetch the data.
    <?php
    include('db.php');
    $per_page = 4; 
    $select_table = "select * from pagination";
    $variable = mysql_query($select_table);
    $count = mysql_num_rows($variable);
    $pages = ceil($count/$per_page)
    ?>
    
    
    <body>
    
    <div id="content" ></div>
    <div class="link" align="center">
                <ul id="paginate">
                    <?php
                      for($i=1; $i<=$pages; $i++)
                    {
                        echo '<li id="'.$i.'">'.$i.'</li>';
                    }
                    ?>
                </ul>   
    </div>
    <div style="clear:both"></div>
    <div id="load" align="center" ></div>
    
    </body>

    CSS

    make as you need for you design with the CSS.
    <style type="text/css">
    body { 
    margin: 0; 
    padding: 0; 
    font-family:Tahoma, Geneva, sans-serif; 
    font-size:18px;
    }
    
    #content{ 
    margin:0 auto; 
    border:0px green dashed; 
    width:800px; 
    min-height:150px; 
    margin-top:100px;
    }
    #load { 
    width:30px;
    padding-top:50px;
    border:0px green dashed;
    margin:0 auto;
    }
    #paginate
    {
    text-align:center;
    border:0px green solid;
    width:500px;
    margin:0 auto;
    }
    .link{
    width:800px; 
    margin:0 auto; 
    border:0px green solid;
    }
    
    li{ 
    list-style: none; 
    float: left;
    margin-right: 16px; 
    padding:5px; 
    border:solid 1px #193d81;
    color:#0063DC; 
    }
    li:hover
    { 
    color:#FF0084; 
    cursor: pointer; 
    }
    </style>
    

    try this code.
  6. If you have any problem regarding this tutorial configuration please feel free to comment we love to answer your queries.