School Library Books Online

Every student has to borrow books from the school library according to book title, author, version. This website can help you reserve your books in distance when you are not inside library.

Together, we create this domain for competition: HackGSU - Fall 2017 Best Domain Name from Domain.com

Learn how to use domain.com create a website domain, learn wamp server, to create a library book database in phpmyadmin, then using index.php(php, mysqli) to connect the database.

Library User Registration<?PHP $output = NULL;

if(isset($_POST['submit'])){ //Connect to database $mysqli = NEW MySQLi('localhost','root','','recipe');

$username = $mysqli->real_escape_string($_POST['username']);
$password = $mysqli->real_escape_string($_POST['password']);
$rpassword = $mysqli->real_escape_string($_POST['rpassword']);
$email = $mysqli->real_escape_string($_POST['email']);

$query = $mysqli->query("SELECT * FROM login WHERE username='$username'");

if(empty($username) OR empty($password) OR empty($email) OR empty($rpassword)){
    $output = "Please fill in all fields.";
}elseif($query->num_rows != 0){
    $output = "That username is already taken.";
}elseif($rpassword != $password){
    $output ="Your password don't match,";
}elseif(strlen($password) < 6){
    $output ="Your password must be at least 5 characters.";
}else{
   //Encrpt the password
   $password = md5($password);

   //Insert the record
   $insert = $mysqli->query("INSERT INTO login(username,password,email) VALUES('$username','$password','$email')");
      if($insert != TRUE){
            $output = "There was a problem <br />";
            $output .= $mysqli->error;
      }else{
          $output = "You have been registered!";
          }




}

} ?>

To borrow book online, please register below

Username:
Password:
Repeat Password:
Email Address:


TERMS OF USE: By logging in to this Web site you agree to abide by all rules and regulations set forth in the TERMS OF USE policy. No bad language is permitted in the postings at any time. Respect the opinions of others—no flame wars allowed!

Built With

Share this project:
×

Updates