By GokiSoft.com| 20:02 19/01/2024|
Học PHP

Quản lý sách bằng PHP - trang quản trị sách bằng PHP - Lập trình PHP BT1670

Thiết kế CSDL đặt tên library gồm 2 bảng.

- user gồm các trường : tên tài khoản, email, họ tên, sđt, mật khẩu

- book gồm các trường : tên sách, tác giả, giá bán, nhà sản xuất

Yêu cầu:

Khi vào web thì hiển thị trang login.php (có chức năng đăng ký => chuyển sang trang signup.php). Khi người dùng login => kiểm trang thông tin trong CSDL => nếu đúng thì đăng nhập thành công => chuyển sang trang quản lý sách

Trang signup.php => Cho phép đăng ký tài khoản mới => Lưu thông tin đăng ký vào CSDL (bảng user)

Thiết kế trang quản lý sách (thêm, sửa, xoá, tìm kiếm). Chỉ xem được trang này khi người dùng đã đăng nhập thành công.

Sử dụng cookie => lưu trạng thái login.

Liên kết rút gọn:

https://gokisoft.com/1670

Bình luận

avatar
Đào Mạnh Dũng [C2010L]
2021-05-14 07:40:05


#form-add.php


<?php
require_once ('../db/dbhelper.php');

$name = $author = $price = $producer = '';

if (!empty($_POST)) {
	$name = getPOST('name');
	$author = getPOST('author');
	$price    = getPOST('price');
	$producer 	  =	getPOST('producer');

	if ($name != '' && $author != '' && $price != '') {
		//save user into database

		$sql = "insert into book (name , author , price , producer) values ('$name','$author', '$price' , '$producer')";
		// echo $sql;//SQL Injection
		execute($sql);

	}
}
?>


#form-delete.php


<?php
require_once ('../db/dbhelper.php');

$username = '';

if (!empty($_POST)) {
	$username = getPOST('username');

	if ($username != '') {
		$sql = "delete from book where name = '$username'";
		execute($sql);
	}
}
?>


#form-login.php


<?php
require_once ('../db/dbhelper.php');

$account = $password = '';

if (!empty($_POST)) {
	$account = getPOST('account');
	$password = getPOST('password');

	if ($account != '' && $password != '') {
		//save user into database
		$password = getPwdSecurity($password);

		$sql   = "select * from users where account = '$account' and password = '$password'";
		$users = executeResult($sql);
 
		if ($users != null && count($users) > 0) {
			//login successfully
			$token = getPwdSecurity(time().$users[0]['email']);
			setcookie('token', $token, time()+7*24*60*60, '/');

			$sql = "update users set token = '$token' where username = '".$users[0]['username']."'";
			execute($sql);
			 
			//chuyen sang trang users.php
			header('Location: users.php');
			die();
		}
	}
}
?>


#form-user.php


<?php
require_once ('../db/dbhelper.php');

$username = $password = $email = $phone = $account = '';

if (!empty($_POST)) {
	$username = getPOST('username');
	$password = getPOST('password');
	$email    = getPOST('email');
	$phone 	  =	getPOST('phone');
	$account  = getPOST('account');

	if ($username != '' && $password != '' && $email != '') {
		//save user into database
		$password = getPwdSecurity($password);

		$sql = "insert into users (account , username , phone , email, password ) values ('$account','$username', '$phone' , '$email' , '$password')";
		// echo $sql;//SQL Injection
		execute($sql);

		//chuyen sang trang login.php
		header('Location: login.php');
		die();
	}
}
?>


#login.php


<?php
require_once ('form-login.php');
?>

<!DOCTYPE html>
<html>
<head>
	<title>Registation Page</title>
	<!-- Latest compiled and minified CSS -->
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">

	<!-- jQuery library -->
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

	<!-- Popper JS -->
	<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>

	<!-- Latest compiled JavaScript -->
	<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
</head>
<body>
	<div class="container">
		<div class="panel panel-primary">
			<div class="panel-heading">
				<h2 class="text-center">Login Page(<a href="register.php">signup</a>)</h2>
			</div>
			<div class="panel-body">
				<form method="post">
					<div class="form-group">
					  <label for="account">account:</label>
					  <input required="true" type="text" class="form-control" id="account" name="account" pattern="[a-zA-Z0-9]{3,}">
					</div>
					<div class="form-group">
					  <label for="pwd">Password:</label>
					  <input required="true" type="password" class="form-control" id="pwd" name="password">
					</div>
					<button class="btn btn-success">Login</button>

				</form>
					
			</div>
		</div>
	</div>
</body>
</html>


#logout.php


<?php
//Cach 1
// setcookie('login', 'true', time()-7*24*60*60, '/');

//Cach 2
$token = '';

if (isset($_COOKIE['token'])) {
	require_once ('../db/dbhelper.php');
	//require_once ('../utils/utility.php');

	$token = $_COOKIE['token'];
	$sql   = "update users set token = null where token = '$token'";
	execute($sql);
}

setcookie('token', '', time()-7*24*60*60, '/');

header('Location: login.php');


#register.php


<?php
require_once ('form-user.php');
?>

<!DOCTYPE html>
<html>
<head>
	<title>Registation Page</title>
	<!-- Latest compiled and minified CSS -->
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">

	<!-- jQuery library -->
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

	<!-- Popper JS -->
	<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>

	<!-- Latest compiled JavaScript -->
	<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
</head>
<body>
	<div class="container">
		<div class="panel panel-primary">
			<div class="panel-heading">
				<h2 class="text-center">Registation Page</h2>
			</div>
			<div class="panel-body">
				<form method="post" id="RegisterForm">
					<div class="form-group">
					  <label for="account">account:</label>
					  <input required="true" type="text" class="form-control" id="account" name="account" pattern="[a-zA-Z0-9]{3,}">
					</div>
					<div class="form-group">
					  <label for="usr">User Name:</label>
					  <input required="true" type="text" class="form-control" id="usr" name="username" pattern="[a-zA-Z0-9]{3,}">
					</div>
					<div class="form-group">
					  <label for="email">Email:</label>
					  <input required="true" type="email" class="form-control" id="email" name="email">
					</div>
					<div class="form-group">
					  <label for="phone">phone:</label>
					  <input required="true" type="number" class="form-control" id="phone" name="phone">
					</div>
					<div class="form-group">
					  <label for="pwd">Password:</label>
					  <input required="true" type="password" class="form-control" id="pwd" name="password">
					</div>
					<div class="form-group">
					  <label for="confirmation_pwd">Confirmation Password:</label>
					  <input required="true" type="password" class="form-control" id="confirmation_pwd" name="confirmation_pwd">
					</div>
					<button class="btn btn-success">Register</button>
				</form>
			</div>
		</div>
	</div>
<script type="text/javascript">
	$(function() {
		$('#RegisterForm').submit(function() {
			if($('[name=password]').val() != $('[name=confirmation_pwd]').val()) {
				alert('Password is not matching, plz check it again!!!')
				return false;
			}
			return true;
		})
	})
</script>
</body>
</html>


#users.php


<?php
require_once ('../db/dbhelper.php');
require_once ('form-add.php');
$user = valiToken();
if ($user == null) {
	header('Location: login.php');
	die();
}
$sql      = "select * from book";
$bookList = executeResult($sql);
?>
<!DOCTYPE html>
<html>
<head>
	<title>Users Page</title>
	<!-- Latest compiled and minified CSS -->
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">

	<!-- jQuery library -->
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

	<!-- Popper JS -->
	<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>

	<!-- Latest compiled JavaScript -->
	<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
</head>
<body>


	<div class="container">
		<div class="panel panel-primary">
			<div class="panel-heading">
				<h2 class="text-center">Users Page - <?=$user['username']?>(<a href="logout.php">logout</a>)</h2>
			</div>
			<div class="panel-body">
				<div class="bs-example">
    <div class="accordion" id="accordionExample">


        <div class="card">
            <div class="card-header" id="headingOne">
                <h2 class="mb-0">
                    <button type="button" class="btn btn-link" data-toggle="collapse" data-target="#collapseOne">1. thêm sách</button>									
                </h2>
            </div>
            <div id="collapseOne" class="collapse" aria-labelledby="headingOne" data-parent="#accordionExample">
                <div class="card-body">


                    <form method="post" id="RegisterForm">
					<div class="form-group">
					  <label for="name">name:</label>
					  <input required="true" type="text" class="form-control" id="name" name="name">
					</div>
					<div class="form-group">
					  <label for="author">author:</label>
					  <input required="true" type="text" class="form-control" id="author" name="author">
					</div>
					<div class="form-group">
					  <label for="price">price:</label>
					  <input required="true" type="number" class="form-control" id="price" name="price">
					</div>
					<div class="form-group">
					  <label for="producer">producer:</label>
					  <input required="true" type="text" class="form-control" id="producer" name="producer">
					</div>
					<button class="btn btn-success">add</button>
				</form>
                </div>
            </div>
        </div>


        <div class="card">
            <div class="card-header" id="headingTwo">
                <h2 class="mb-0">
                    <button type="button" class="btn btn-link collapsed" data-toggle="collapse" data-target="#collapseTwo">2. quản lý sách</button>
                </h2>
            </div>
            <div id="collapseTwo" class="collapse show" aria-labelledby="headingTwo" data-parent="#accordionExample">
                <div class="card-body">
                                   
	<table class="table table-bordered">
					<thead>
						<tr>
							<th>No</th>
							<th>tên sách</th>
							<th>tác giả</th>
							<th>giá bán</th>
							<th>nhà sản xuất</th>
							<th style="width: 50px;"></th>
							<th style="width: 50px;"></th>
						</tr>
					</thead>
					<tbody>
<?php
$count = 0;
foreach ($bookList as $item) {
	echo '<tr>
			<td>'.(++$count).'</td>
			<td>'.$item['name'].'</td>
			<td>'.$item['author'].'</td>
			<td>'.$item['price'].'</td>
			<td>'.$item['producer'].'</td>
			<td><button class="btn btn-warning">Edit</button></td>
			<td><button class="btn btn-danger" onclick="deleteUsers(\''.$item['name'].'\')">Delete</button></td>
		</tr>';
}
?>
					</tbody>
				</table>



                                   
                </div>
            </div>
        </div>


        

    </div>
</div>
			</div>
		</div>
	</div>
<script type="text/javascript">
	function deleteUsers(username) {
		option = confirm('Are you sure to delete this user?')
		if(!option) return

		$.post('form-delete.php', {
			'username': username
		}, function(data) {//callback -> khi du lieu dc tra ve tu server
			location.reload() //load website -> khong load cung dc -> su dung jquery de update data -> tuy vao nghiep cua du an.
		})
	}
</script>
</body>
</html>


avatar
Đỗ Văn Huấn [T1907A]
2020-06-23 15:33:02

https://github.com/huandv21-8/php/tree/master/Example/baiTapNgay17_6_2020/bai2

avatar
Minh Nghia [T1907A]
2020-06-22 15:54:42



https://github.com/minhnghia07/abc/tree/master/Book


avatar
Trần Mạnh Dũng [T1907A]
2020-06-22 14:17:53

https://github.com/dungki/quanlysach.git

avatar
Phí Văn Long [T1907A]
2020-06-21 17:59:31

https://bookmanagerusephp.herokuapp.com/

https://github.com/philong192001/BookManagerUsePHP.github.io.git

avatar
thienphu [T1907A]
2020-06-21 08:39:30

https://github.com/ThienPhuDev97/T1907A_Java/tree/master/manageBook

avatar
Trương Công Vinh [T1907A]
2020-06-20 05:45:37

https://github.com/Congvinh18122001/BookwebBasic

https://congvinh18122001.github.io/BookwebBasic/

avatar
Trương Công Vinh [T1907A]
2020-06-20 05:44:30



<?php
require_once ('dbhelper.php');
$bookname  = $authorname = $price =$pblcmp= '';
if (!empty($_POST)) {
  // code...
  if (isset($_POST['bookname'])) {
    // code...
    $bookname = $_POST['bookname'];

  }
  if (isset($_POST['authorname'])) {
    // code...
$authorname=$_POST['authorname'];
  }
  if (isset($_POST['price'])) {
    // code...
    $price =$_POST['price'];

  }
  if (isset($_POST['publish'])) {
    // code...
    $pblcmp = $_POST['publish'];
  }


   $sql = "insert into book(bookname,authorname,fullname,price,publish) values ('$bookname','$authorname','$price','$pblcmp')";
   execute($sql);
  }
header('Location:book.php');
 ?>



<?php
require_once ('dbhelper.php');
$username=$email=$fullname=$sdt=$password = '';
if (!empty($_POST)) {
  // code...
  if (isset($_POST['username'])) {
    // code...
    $username = $_POST['username'];

  }
  if (isset($_POST['email'])) {
    // code...
$email=$_POST['email'];
  }
  if (isset($_POST['password'])) {
    // code...
    $password =$_POST['password'];

  }
  if (isset($_POST['sdt'])) {
    // code...
    $sdt = $_POST['sdt'];
  }
  if (isset($_POST['fullname'])) {
    // code...
    $fullname = $_POST['fullname'];
  }

   $sql = "insert into usr(username,email,fullname,phonenumber,password) values ('$username','$email','$fullname','$sdt','$password')";
   execute($sql);

  }
header('Location:login.php');

 ?>



<?php
if (!isset($_COOKIE['status'])|| ($_COOKIE['status']!='login-success')) {
  // code...
  header('Location:login.php');
  die();
}
 ?>
<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</head>
<body>

<div class="container">
  <h3>Book Information</h3>
  <ul class="nav nav-tabs">
    <li class="active"><a href="book.php">Home</a></li>

    <li><a href="user.php">Person Information</a></li>

  </ul>


  <div class="panel panel-primary">
			<div class="panel-heading">
				Quản lý thông tin Sách
				<form method="get">
					<input type="text" name="s" class="form-control" style="margin-top: 15px; margin-bottom: 15px;" placeholder="Tìm kiếm theo tên sách">
				</form>
			</div>
			<div class="panel-body">
				<table class="table table-bordered">
					<thead>
						<tr>
							<th>STT</th>
							<th>Tên Sách</th>
							<th>Tác giả</th>
							<th>Giá sách</th>
              <th>Nhà xuất bản</th>
							<th width="60px"></th>
							<th width="60px"></th>
						</tr>
					</thead>
					<tbody>
<?php

require_once ('dbhelper.php');

 $bookList=[];



if (isset($_GET['s']) && $_GET['s'] != '') {
	$sql = 'select * from book where bookName like "%'.$_GET['s'].'%"';
} else {
	$sql = 'select * from book';
}
$bookList = execute_result($sql);

$index = 0;
foreach ($bookList as $book) {
	echo '<tr>
			<td>'.(++$index).'</td>
			<td>'.$book['bookName'].'</td>
			<td>'.$book['authorNanme'].'</td>
			<td>'.$book['price'].'</td>
      <td>'.$book['publishComp'].'</td>
			<td><button class="btn btn-warning" onclick=\'window.open("inputBook.php?id='.$book['id'].'","_self")\'>Edit</button></td>
			<td><button class="btn btn-danger" onclick="deleteBook('.$book['id'].')">Delete</button></td>
		</tr>';
}
?>
					</tbody>
				</table>
				<button class="btn btn-success" onclick="window.open('inputBook.php', '_self')">Add Book</button>
			</div>
		</div>
</div>
<script type="text/javascript">
		function deleteBook(id) {
			option = confirm('Bạn có muốn xoá quyển sách này không')
			if(!option) {
				return;
			}

			console.log(id)
			$.post('deleteBook.php', {
				'id': id
			}, function(data) {
				alert(data)
				location.reload()
			})
		}
	</script>
</body>
</html>



<?php

define('HOST', 'localhost');
define('DATABASE', 'less5');
define('USERNAME', 'root');
define('PASSWORD', '');
 ?>



CREATE TABLE book(
id int PRIMARY KEY AUTO_INCREMENT,
bookName varchar(50),
authorNanme varchar(5),
price float,
publishComp varchar(50)
)
go
CREATE TABLE usr (
username varchar(20) PRIMARY KEY,
email varchar(50),
fullname varchar(50),
phonenumber varchar(11),
password varchar(30)
)



<?php
require_once('config.php');
function execute($sql) {
	$con = mysqli_connect(HOST, USERNAME, PASSWORD, DATABASE);

	mysqli_query($con, $sql);


	mysqli_close($con);

}

function execute_result($sql) {

	$con = mysqli_connect(HOST, USERNAME, PASSWORD, DATABASE);

	$resultset  = mysqli_query($con, $sql);
	$resultList = [];
	while ($row = mysqli_fetch_array($resultset, 1)) {
		$resultList[] = $row;
	}


	mysqli_close($con);

	return $resultList;
}

 ?>



<?php
if (isset($_POST['id'])) {
	$id = $_POST['id'];

	require_once ('dbhelper.php');
	$sql = 'delete from book where id = '.$id;
	execute($sql);

	echo 'Xoá thành công';
}



<?php

if (isset($_COOKIE['status']) && ($_COOKIE['status'] == 'login-success')) {
  // code...
  header('Location:book.php');
  die();
}
$username=$password='';
require_once('dbhelper.php');
$sql = 'select username,password from usr';
$accList = execute_result($sql);
if (!empty($_POST)) {
  // code...
  if (isset($_POST['username'])) {
    // code...
    $username = $_POST['username'];
  }
  if (isset($_POST['pswd'])) {
    // code...
    $password =$_POST['pswd'];
  }
}
foreach ($accList as $acc) {
  // code...
  if ($acc['username']==$username && $acc['password']==$password) {
    // code...
    setcookie('status','login-success',time()+(24*60*60),'/');
    setcookie('usename',$username,time()+(24*60*60),'/');
    header('Location:book.php');

    break;
    die();
  }
}

 ?>
<!DOCTYPE html>
<html lang="en">
<head>
  <title>Login</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>
</head>
<body>

<div class="container">
  <h2>Login Account Book Management</h2>
  <form action="" method="post">
    <div class="form-group">
      <label for="usr">Username:</label>
      <input required="true" type="text" name="username" class="form-control" id="usr">
    </div>
    <div class="form-group">
      <label for="pwd">Password:</label>
      <input type="password" class="form-control" id="pwd" placeholder="Enter password" name="pswd">
    </div>
    <div class="form-group form-check">
      <label class="form-check-label">
        <input class="form-check-input" type="checkbox" name="remember"> Remember me
      </label>
    </div>
    <button type="submit" class="btn btn-primary">Submit</button>
    <a href="register.html" class="btn btn-primary">Register </a>
  </form>
</div>

</body>
</html>



<?php
if (!isset($_COOKIE['status'])||$_COOKIE['status']!='login-success') {
  // code...
  header('Location: login.php');
  die();
}
 ?>
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
	<title>Registation </title>
	<!-- Latest compiled and minified CSS -->
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">

	<!-- jQuery library -->
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

	<!-- Popper JS -->
	<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>

	<!-- Latest compiled JavaScript -->
	<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
</head>
<body>
	<div class="container">
		<div class="panel panel-primary">
			<div class="panel-heading">
				<h2 class="text-center"> Input Book's Detail Information</h2>
			</div>
			<div class="panel-body">
				<form class="" action="addBook.php" method="post">
					<div class="form-group">
						<label for="usr">bookName:</label>
						<input required="true" type="text" name="bookname" class="form-control" id="usr">
					</div>
          <div class="form-group">
						<label for="usr">authorName:</label>
						<input required="true" type="text" name="authorname" class="form-control" id="usr">
					</div>
          <div class="form-group">
						<label for="usr">Price:</label>
						<input required="true" type="text" name="price" class="form-control" id="usr">
					</div>
					<div class="form-group">
						<label for="phone">Publish compani :</label>
						<input required="true" type="text" name="publish" class="form-control" id="phone">
					</div>





					<button class="btn btn-success" type="submit">Add</button>
				</div>
				</form>
		</div>
	</div>
</body>
</html>



<?php
setcookie('status','login-success',time()-24*60*60,'/');
setcookie('username',$_COOKIE['username'],time()-24*60*60,'/');
header('Location:login.php');
die();
 ?>




<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
	<title>Registation </title>
	<!-- Latest compiled and minified CSS -->
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">

	<!-- jQuery library -->
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

	<!-- Popper JS -->
	<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>

	<!-- Latest compiled JavaScript -->
	<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
</head>
<body>
	<div class="container">
		<div class="panel panel-primary">
			<div class="panel-heading">
				<h2 class="text-center"> Input Book's Detail Information</h2>
			</div>
			<div class="panel-body">
				<form class="" action="addUser.php" method="post">
					<div class="form-group">
						<label for="usr">Username:</label>
						<input required="true" type="text" name="username" class="form-control" id="usr">
					</div>
          <div class="form-group">
						<label for="email">Email:</label>
						<input required="true" type="email" name="email" class="form-control" id="email">
					</div>
          <div class="form-group">
						<label for="name">Fullname:</label>
						<input required="true" type="text" name="fullname" class="form-control" id="name">
					</div>
					<div class="form-group">
						<label for="phone">Telephone number :</label>
						<input required="true" type="text" name="sdt" class="form-control" id="phone">
					</div>
					<div class="form-group">
						<label for="prwd">Password :</label>
						<input required="true" type="password" name="password" class="form-control" id="prwd">
					</div>




					<button class="btn btn-success" type="submit">Register</button>
					<a href="index.php" class="btn btn-success">Login</a>
				</div>
				</form>
		</div>
	</div>
</body>
</html>




<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
	<title>Registation </title>
	<!-- Latest compiled and minified CSS -->
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">

	<!-- jQuery library -->
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

	<!-- Popper JS -->
	<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>

	<!-- Latest compiled JavaScript -->
	<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
</head>
<body>
	<div class="container">
		<div class="panel panel-primary">
			<div class="panel-heading">
				<h2 class="text-center"> Input Book's Detail Information</h2>
			</div>
			<div class="panel-body">
				<form class="" action="addUser.php" method="post">
					<div class="form-group">
						<label for="usr">Username:</label>
						<input required="true" type="text" name="username" class="form-control" id="usr">
					</div>
          <div class="form-group">
						<label for="email">Email:</label>
						<input required="true" type="email" name="email" class="form-control" id="email">
					</div>
          <div class="form-group">
						<label for="name">Fullname:</label>
						<input required="true" type="text" name="fullname" class="form-control" id="name">
					</div>
					<div class="form-group">
						<label for="phone">Telephone number :</label>
						<input required="true" type="text" name="sdt" class="form-control" id="phone">
					</div>
					<div class="form-group">
						<label for="prwd">Password :</label>
						<input required="true" type="password" name="password" class="form-control" id="prwd">
					</div>




					<button class="btn btn-success" type="submit">Register</button>
					<a href="index.php" class="btn btn-success">Login</a>
				</div>
				</form>
		</div>
	</div>
</body>
</html>