PHP Tutorials: How To CRUD With PHP And MySQL

This video learn how to CRUD with PHP and MySQL

What is CRUD?

C is Create
R is Remove
U is Update
D is Display



In this video I have an example want to show you with
my web hosting using GoDaddy

I have domain name want2learn.info and database name is ´test_customer_db´ and table name is ´tbl_customers´.

I have 5 fields in this table

- customerid
- firstname
- lastname
- address

- contact

And then write php codes 

Create file config.php to connect with database

<?php

$mysql_hostname = "localhost";
$mysql_user = "test2015";
$mysql_password = "test2015";
$mysql_database = "test_customer_db";

$bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("Opps some thing went wrong");
mysql_select_db($mysql_database, $bd) or die("Opps some thing went wrong");

?>

Create file index.php to display customers

<?php

include('includes/config.php');

$sql = "SELECT * FROM tbl_customers ORDER BY firstname";
$rsd = mysql_query($sql);

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Display Customers</title>
</head>
<body>
<a href="new_customer.php" title="Add New Customer">Add New Customer</a><br/><br/>
<table border="1" cellpadding="3" cellspacing="3">
<tr>
<th width="30">No. </th>
<th width="120">Customer Id</th>
<th width="120">First Name</th>
<th width="120">Last Name</th>
<th width="120">Address</th>
<th width="100">Contact</th>
<th width="25">&nbsp; </th>
<th width="25">&nbsp; </th>
</tr>
<?php
$n = 0;
while($row = mysql_fetch_array($rsd))
{
$n = $n + 1;
$f1 = $row['customerid'];
$f2 = $row['firstname'];
$f3 = $row['lastname'];
$f4 = $row['address'];
$f5 = $row['contact'];
?>
<tr>
<td><?php echo $n; ?></td>
<td><?php echo $f1; ?></td>
<td><?php echo $f2; ?></td>
<td><?php echo $f3; ?></td>
<td><?php echo $f4; ?></td>
<td><?php echo $f5; ?></td>
<td><a href="update_customer.php?id=<?php echo $f1 ?>">Edit</a></td>
<td><a href="delete_customer_data.php?id=<?php echo $f1 ?>">Delete</a></td>
</tr>
<?php
} //while
?>
</table>
</body>

</html>

Create file new_customer.php to add new customer form

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Add New Customer</title>
</head>

<body>
<form method="post" action="save_customer_data.php">
Customer Id<br/>
<input type="text" name="f1"/><br/>
First Name<br/>
<input type="text" name="f2"/><br/>
Last Name<br/>
<input type="text" name="f3"/><br/>
Address<br/>
<textarea rows="3" name="f4"></textarea><br/>
Contact<br/>
<input type="text" name="f5"/><br/>
<input type="submit" value="Save" title="Save"/>
</form>
</body>
</html>

Create file save_customer_data.php to save customer data into database

<?php
include('includes/config.php');

$f1 = $_POST['f1']; //Customer id
$f2 = $_POST['f2']; //First Name
$f3 = $_POST['f3']; //Last Name
$f4 = $_POST['f4']; //Address
$f5 = $_POST['f5']; //Contact

mysql_query("INSERT INTO tbl_customers (customerid, firstname, lastname, address, contact) VALUES ('". $f1 ."', '". $f2 ."', '". $f3 ."', '". $f4 ."', '". $f5 ."')");
mysql_close($bd);
header("location: http://www.want2learn.info/website/");

?>

Create file delete_customer_data.php to delete customer from database

<?php

include('includes/config.php');

$id = $_GET['id'];
mysql_query("DELETE FROM tbl_customers WHERE customerid='". $id ."'");
mysql_close($bd);

ob_start();
header("location: http://www.want2learn.info/website/");


?>

Create file update_customer.php to update customer

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Update Customer</title>
</head>
<body>
<form action="save_update_customer_data.php" method="post">
<?php

include('includes/config.php');

$id = $_GET['id'];

$result = mysql_query("SELECT * FROM tbl_customers WHERE customerid='". $id ."'") or die($result."<br/><br/>".mysql_error());

while($row = mysql_fetch_array($result, MYSQL_BOTH))
{  
echo "<input name='f1' value='". $id ."' type='hidden'/>";

echo "First Name<br/>";
echo "<input name='f2' value='". $row['firstname'] ."' type='text'/><br/>";

echo "Last Name<br/>";
echo "<input name='f3' value='". $row['lastname'] ."' type='text'/><br/>";

echo "Address<br/>";
echo "<textarea name='f4' rows='3'>". $row['address'] ."</textarea><br/>";

echo "Contact<br/>";
echo "<input name='f5' value='". $row['contact'] ."' type='text'/><br/>";
}
?>
<br/>
<input type="submit" title="Update" value="Update"/>
</form>
</body>

</html>

Create file save_update_customer_data.php to save update customer into database

<?php

include('includes/config.php');

if(isset($_POST['f1'], $_POST['f2'], $_POST['f3'], $_POST['f4'], $_POST['f5'])){

$f1 = $_POST['f1']; //Customer id
$f2 = $_POST['f2']; //First Name
$f3 = $_POST['f3']; //Last Name
$f4 = $_POST['f4']; //Address
$f5 = $_POST['f5']; //Contact

mysql_query("UPDATE tbl_customers SET firstname='". $f2 ."', lastname='". $f3 ."', address='". $f4 ."', contact='". $f5 ."' WHERE customerid='". $f1 ."'");

mysql_close($bd);

header("location: http://www.want2learn.info/website/");
}


?>

How To Create Website Pizza Shop Using PHP with PayPal REST API

This video learn how to create website Pizza shop using PHP with PayPal REST API



Step 1

Pizza App using PayPal REST API
https://github.com/paypal/rest-api-sample-app-php

Step 2

- Create database "paypal_pizza_app" in phpmyadmin
- Extract source codes with step 1 and then create table with install folder

Step 3
- You have a paypal account and status verified 
- Setup API Access in your profile 

Step 4
Login into paypal developer and create app
https://developer.paypal.com/developer


Step 5
Update file bootstrap.php in app folder for connection parameters and SDK Configuration with client id and secret with step 3

Step 6
Download Composer
https://getcomposer.org/download/


Step 7
Composer Update

Open command (Window + R) and then write commands here

c:\cd xampp

C:\xampp>cd php

C:\xampp\php>php -r "eval('?>'.file_get_contents('https://getcomposer.org/installer'));"

Create file composer.bat in c:/xampp/php/

@ECHO OFF
SET SUBDIR=%~dp0
php %SUBDIR%\composer.phar %*

Run composer.bat

Step 8
Copy file composer.phar paste to c:/xampp/htdocs/pizza

and then write command

C:\xampp\htdocs\pizza> php composer.phar self-update
C:\xampp\htdocs\pizza> php composer.phar install


Step 9
Demo
http://localhost/pizza


How To Display Data From Database Using Bootstrap Responsive Table With Pagination

This video learn how to display data from database using bootstrap responsive table with pagination.



Before you start learn with me you have bootstrap

step 1

Go to download bootstrap from www.getbootstrap.com

step 2

Go to XAMPP and then create web project with display pagination

step 3

Extract bootstrap zip file to c:/xampp/htdocs/websitebootstrap/

step 4

Go to phpmyadmin and then create database name "maps"


CREATE DATABASE maps;

and then create table "markers"

CREATE TABLE `markers` (
  `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  `name` VARCHAR( 60 ) NOT NULL ,
  `address` VARCHAR( 80 ) NOT NULL ,
  `lat` FLOAT( 10, 6 ) NOT NULL ,
  `lng` FLOAT( 10, 6 ) NOT NULL ,
  `type` VARCHAR( 30 ) NOT NULL
) ENGINE = MYISAM ;

and then insert data

INSERT INTO `markers` (`name`, `address`, `lat`, `lng`, `type`) VALUES ('Pan Africa Market', '1521 1st Ave, Seattle, WA', '47.608941', '-122.340145', 'restaurant');
INSERT INTO `markers` (`name`, `address`, `lat`, `lng`, `type`) VALUES ('Buddha Thai & Bar', '2222 2nd Ave, Seattle, WA', '47.613591', '-122.344394', 'bar');
INSERT INTO `markers` (`name`, `address`, `lat`, `lng`, `type`) VALUES ('The Melting Pot', '14 Mercer St, Seattle, WA', '47.624562', '-122.356442', 'restaurant');
INSERT INTO `markers` (`name`, `address`, `lat`, `lng`, `type`) VALUES ('Ipanema Grill', '1225 1st Ave, Seattle, WA', '47.606366', '-122.337656', 'restaurant');
INSERT INTO `markers` (`name`, `address`, `lat`, `lng`, `type`) VALUES ('Sake House', '2230 1st Ave, Seattle, WA', '47.612825', '-122.34567', 'bar');
INSERT INTO `markers` (`name`, `address`, `lat`, `lng`, `type`) VALUES ('Crab Pot', '1301 Alaskan Way, Seattle, WA', '47.605961', '-122.34036', 'restaurant');
INSERT INTO `markers` (`name`, `address`, `lat`, `lng`, `type`) VALUES ('Mama\'s Mexican Kitchen', '2234 2nd Ave, Seattle, WA', '47.613975', '-122.345467', 'bar');
INSERT INTO `markers` (`name`, `address`, `lat`, `lng`, `type`) VALUES ('Wingdome', '1416 E Olive Way, Seattle, WA', '47.617215', '-122.326584', 'bar');
INSERT INTO `markers` (`name`, `address`, `lat`, `lng`, `type`) VALUES ('Piroshky Piroshky', '1908 Pike pl, Seattle, WA', '47.610127', '-122.342838', 'restaurant');

and then write php codes for connect to database

config.php

<?php
$mysql_hostname = "localhost";
$mysql_user = "root";
$mysql_password = "";
$mysql_database = "maps";

$bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("Opps some thing went wrong");
mysql_select_db($mysql_database, $bd) or die("Opps some thing went wrong");

?>

and then create index.php

<?php

include('includes/config.php');

$per_page = 5;
$adjacents = 5; 

$pages_query = mysql_query("SELECT COUNT(id), name, address, lat, lng, type FROM markers") or die(mysql_error());

//get total number of pages to be shown from  total result
$pages = ceil(mysql_result($pages_query, 0) / $per_page);

//get current page from URL ,if not present set it to 1
$page = (isset($_GET['page'])) ? (int)$_GET['page'] : 1 ;

//calculate actual start page with respect to Mysql 
$start = ($page - 1) * $per_page;

//execute a mysql query to retrieve  all result from current page by using LIMIT keyword in mysql
//if  query  fails stop further execution and show mysql error

$query = mysql_query("SELECT id, name, address, lat, lng, type FROM markers LIMIT $start, $per_page") or die(mysql_error());

$pagination="Pagination";
//if current page is first show first only else reduce 1 by current page
$Prev_Page = ($page==1)?1:$page - 1;

//if current page is last show last  only else add  1 to  current page
$Next_Page = ($page>=$pages)?$page:$page + 1;

//if we are not on first page show first link
if($page!=1) $pagination.= '<a href="?page=1">First</a>';
//if we are not on first page show previous link
if($page!=1) $pagination.='<a href="?page='.$Prev_Page.'">Previous</a>';

//we are going to display 5 links on pagination bar
$numberoflinks=5;

//find the number of links to show on right of current page
$upage=ceil(($page)/$numberoflinks)*$numberoflinks;
//find the number of links to show on left of current page
$lpage=floor(($page)/$numberoflinks)*$numberoflinks;
//if  number of links on left of current page are zero we start from 1
$lpage=($lpage==0)?1:$lpage;
//find the number of links to show on right of current page and make sure it must be less than total number of pages
$upage=($lpage==$upage)?$upage+$numberoflinks:$upage;
if($upage>$pages)$upage=($pages-1);
//start building links from left to right of current page
for($x=$lpage; $x<=$upage; $x++){
//if current building link is current page we don't show link,we show as text else we show as linkn
$pagination.=($x == $page) ? ' <strong>'.$x.'</strong>' : ' <a href="?page='.$x.'">'.$x.'</a>' ;
}
//we show next link and last link if user doesn't on last page
if($page!=$pages) $pagination.=  '  <a href="?page='.$Next_Page.'">Next</a>';
if($page!=$pages) $pagination.=  ' <a href="?page='.$pages.'">Last</a>';


?>

<!DOCTYPE html>
<html lang="en">

<head>
<meta content="width=device-width, initial-scale=1" name="viewport">
<title>How To Display Data From Database Using Bootstrap Responsive Table With Pagination
</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
</head>

<body>

<div class="container-fluid">
<h3>Display Location Address</h3>
<div class="table-responsive">
 <table class="table">
   <tr>
    <th>Location</th>
    <th>Address</th>
    <th>Latitude</th>
    <th>Longtitude</th>
    <th>Type</th>
   </tr>
   <?php
while($row = mysql_fetch_array($query))
{
$f1 = $row['name'];
$f2 = $row['address'];
$f3 = $row['lat'];
$f4 = $row['lng'];
$f5 = $row['type'];
?>
<tr>
<td><?php echo $f1 ?></td>
<td><?php echo $f2 ?></td>
<td><?php echo $f3 ?></td>
<td><?php echo $f4 ?></td>
<td><?php echo $f5 ?></td>
</tr>
<?php
} //while
?>
 </table>
</div>
<nav>
 <ul class="pager">
   <li><a href="#"><?php echo $pagination; ?></a></li>    
 </ul>
</nav>
</div>

<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>

</body>

GoDaddy Review with cheap price $1 per month Hosting + Free domain! Stick it to the slow websites!

This video about GoDaddy review with cheap price $1 per month Hosting + Free domain! Stick it to the slow websites!



I Recommended

For web design and developer buy it to learn and improve their project experiments and work with a good web hosting.

ECONOMY WEB HOSTING

- 1 Website
- 100 GB Storage
- Unlimited Bandwidth
- 100 Email Addresses
- Free domain with annual plan. Read more 

Buy Now
http://www.dpbolvw.net/click-7577222-10864024

Follow Us with Facebook
https://www.facebook.com/pages/PHP-Tutorial/782239958529506

CodeIgniter Tutorial: How To Login Using CodeIgniter

This video learn how to login using Codeigniter.



1- Create Database "logindb" and then create table

CREATE TABLE tbl_users (
userid tinyint(4) NOT NULL AUTO_INCREMENT,
username varchar(10) NOT NULL,
password varchar(100) NOT NULL,
PRIMARY KEY (userid)
)ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1

2- Insert New Row

INSERT INTO tbl_users(username,password) VALUES('demo',md5('test'));

3- Download Codeigniter

   - Create web directory name or web root 'loginwebsite'
   - Extract codeigniter to web root 'loginwebsite'

     application
     system
     index.php

4- Update application/config/database.php

$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'root';
$db['default']['password'] = '';
$db['default']['database'] = 'logindb';

5- Update $route['default_controller'] = "loginwebsite"; in application/config/routes.php

6- Update application/config/autoload.php

$autoload['libraries'] = array('database','session');
$autoload['helper'] = array('url');

7- Update encryption_key in application/config/config.php

$config['encryption_key'] = 'APANtByIGI1BpVXZTJgcsAG8GZl8pdwwa84'

8- Create User Model in application/models/user.php

<?php
Class User extends CI_Model
{
 function login($username, $password)
 {
   $this -> db -> select('userid, username, password');
   $this -> db -> from('tbl_users');
   $this -> db -> where('username', $username);
   $this -> db -> where('password', MD5($password));
   $this -> db -> limit(1);

   $query = $this -> db -> get();

   if($query -> num_rows() == 1)
   {
     return $query->result();
   }
   else
   {
     return false;
   }
 }
}
?>

9- Create Login Controller in application/controllers/login.php

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Login extends CI_Controller {

 function __construct()
 {
   parent::__construct();
 }

 function index()
 {
   $this->load->helper(array('form'));
   $this->load->view('login_view');
 }

}

?>

10- Create Login View in application/views/login_view.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
   <title>Simple Login with CodeIgniter</title>
 </head>
 <body>
   <h1>Simple Login with CodeIgniter</h1>

   <?php echo validation_errors(); ?>

   <?php echo form_open('verifylogin'); ?>
     <label for="username">Username:</label>
     <input type="text" size="20" id="username" name="username"/>
     <br/>
     <label for="password">Password:</label>
     <input type="password" size="20" id="passowrd" name="password"/>
     <br/>
     <input type="submit" value="Login"/>
   </form>
 </body>
</html>

11- Create VerifyLogin Controller in application/controllers/verifylogin.php

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class VerifyLogin extends CI_Controller {

 function __construct()
 {
   parent::__construct();
   $this->load->model('user','',TRUE);
 }

 function index()
 {
   //This method will have the credentials validation
   $this->load->library('form_validation');

   $this->form_validation->set_rules('username', 'Username', 'trim|required|xss_clean');
   $this->form_validation->set_rules('password', 'Password', 'trim|required|xss_clean|callback_check_database');

   if($this->form_validation->run() == FALSE)
   {
     //Field validation failed.  User redirected to login page
     $this->load->view('login_view');
   }
   else
   {
     //Go to private area
     redirect('home', 'refresh');
   }
 }

 function check_database($password)
 {
   //Field validation succeeded.  Validate against database
   $username = $this->input->post('username');

   //query the database
   $result = $this->user->login($username, $password);

   if($result)
   {
     $sess_array = array();
     foreach($result as $row)
     {
       $sess_array = array(
         'userid' => $row->userid,
         'username' => $row->username
       );
       $this->session->set_userdata('logged_in', $sess_array);
     }
     return TRUE;
   }
   else
   {
     $this->form_validation->set_message('check_database', 'Invalid username or password');
     return false;
   }
 }
}
?>

12- Create Home Controller in application/controllers/home.php

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
session_start(); //we need to call PHP's session object to access it through CI
class Home extends CI_Controller {

 function __construct()
 {
   parent::__construct();
 }

 function index()
 {
   if($this->session->userdata('logged_in'))
   {
     $session_data = $this->session->userdata('logged_in');
     $data['username'] = $session_data['username'];
     $this->load->view('home_view', $data);
   }
   else
   {
     //If no session, redirect to login page
     redirect('login', 'refresh');
   }
 }

 function logout()
 {
   $this->session->unset_userdata('logged_in');
   session_destroy();
   redirect('home', 'refresh');
 }
}
?>

13- Create Home View in application/views/home_view.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
   <title>Simple Login with CodeIgniter - Private Area</title>
 </head>
 <body>
   <h1>Home</h1>
   <h2>Welcome <?php echo $username; ?>!</h2>
   <a href="home/logout">Logout</a>
 </body>
</html>

14- Demo
http://localhost/loginwebsite/index.php/login

15- Source
http://downloads.ziddu.com/download/24382218/loginwebsite.zip.html

Read more blog
http://www.freeonlinelecture.com

Follow Us with Facebook
https://www.facebook.com/pages/PHP-Tutorial/782239958529506

CodeIgniter Tutorial: How To Remove Index From URL with CodeIgniter Using .htaccess

This video learn how to remove index from URL with Codeigniter using .htaccess


Demo
http://downloads.ziddu.com/download/24381792/curlwebsite.zip.html

Read more blog

PHP-MySQL Login Using Bootstrap

This video learn about PHP-MySQL Login Using Bootstrap



1- Create Database "bootstrap" and then create table

CREATE TABLE tbl_users

- userid
- username
- password

2- Insert New Row

INSERT INTO tbl_users(username,password) VALUES('demo@gmail.com',md5('test'));

3- Download Bootstrap

4- Write PHP-MySQL codes for login

Create web directory name or web root 'clogin'

Extract bootstrap with css, js, fonts to clogin

Create folder includes in web root

config.php (Save to includes)

<?php
$mysql_hostname = "localhost";
$mysql_user = "root";
$mysql_password = "";
$mysql_database = "bootstrap";

$bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("Opps some thing went wrong");
mysql_select_db($mysql_database, $bd) or die("Opps some thing went wrong");
?>

index.php (Save to web root)

<?php
header("location: login.php");
?>

login.php (Save to web root)

<?php
session_start();
include("includes/config.php");

if($_SERVER["REQUEST_METHOD"] == "POST")
{
// username and password sent from form 
$myusername = addslashes($_POST['username']); 
$mypassword = md5(addslashes($_POST['password']));

$sql = "SELECT userid FROM tbl_users WHERE username='$myusername' and password='$mypassword'";
$result = mysql_query($sql);
$count = mysql_num_rows($result);

// If result matched $myusername and $mypassword, table row must be 1 row
if($count == 1){
//session_register("myusername");
$_SESSION['login_admin']=$myusername;
header("location: http://localhost/clogin/admin/");
}
}
?>

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="">

    <title>PHP-MySQL Login Using Bootstrap</title>

    <!-- Bootstrap core CSS -->
    <link href="css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="css/signin.css" rel="stylesheet">
</head>

<body>

<div class="container">

      <form class="form-signin" method="post">
        <h2 class="form-signin-heading">Login</h2>
        <label for="inputEmail" class="sr-only">Email address</label>
        <input name="username" type="email" id="inputEmail" class="form-control" placeholder="Email address" required autofocus>
        <label for="inputPassword" class="sr-only">Password</label>
        <input name="password" type="password" id="inputPassword" class="form-control" placeholder="Password" required>
        <div class="checkbox">
          <label>
            <input type="checkbox" value="remember-me"> Remember me
          </label>
        </div>
        <button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>        
      </form>

</div> <!-- /container -->
</body>
</html>

logout.php (Save to Web root)

<?php
session_start();
if(session_destroy())
{
header("Location: index.php");
}
?>

Create folder admin in web root

index.php (Save to admin)


<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../../favicon.ico">

    <title>Dashboard Bootstrap</title>

    <!-- Bootstrap core CSS -->
    <link href="../css/bootstrap.min.css" rel="stylesheet">
    <style>
    body {
  padding-top: 50px;
}
.starter-template {
 padding: 40px 15px;
 text-align: center;
}
    </style>
  </head>

  <body>
    <nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="#">Dashboard</a>
        </div>
        <div id="navbar" class="collapse navbar-collapse">
          <ul class="nav navbar-nav">
            <li class="active"><a href="#">Home</a></li>
            <li><a href="#about">About</a></li>
            <li><a href="#contact">Contact</a></li>
            <li><a href="../logout.php">Log Out</a></li>
          </ul>
        </div><!--/.nav-collapse -->
      </div>
    </nav>

    <div class="container">

      <div class="starter-template">
        <h1>Dashboard</h1>
        <p class="lead">
        Dashboard page is under construction
        </p>
      </div>

    </div><!-- /.container -->


    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
    <script src="../js/bootstrap.min.js"></script>
  </body>
</html>

Demo
http://downloads.ziddu.com/download/24380544/clogin.zip.html

Read more blog
http://www.freeonlinelecture.com

Follow Us with Facebook
https://www.facebook.com/pages/PHP-Tutorial/782239958529506