signup.php

 <?php

require "functions.php";
// echo "connected successfully"
if($_SERVER['REQUEST_METHOD'] =="POST")
{
$username = $_POST['username'];
$email = $_POST['email'];
$password = ['password'];
$date = date('Y-m-d,H:i:s');

$query ="insert into faizanblog (username,email,password,date) value ('$username','$email','$password','$date')";

$result = mysqli_query($con,$query);

header("Location:login.php");
die;
}
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>SIGNUP-MYWEBSITE</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<style>
    .container{
        width: 50%;
        margin-left: 400px;
      }
</style>
</head>
<body>
    <?php require"header.php";?>
<div class="container">
    <form method="post">
      <div class="mb-3">
        <label for="exampleInputEmail1" class="form-label">Username</label>
        <input type="text" class="form-control" name="username" id="exampleInputEmail1" aria-describedby="emailHelp">
      </div>
      <div class="mb-3">
        <label for="exampleInputEmail1" class="form-label">Email address</label>
        <input type="email" class="form-control" name="email"id="exampleInputEmail1" aria-describedby="emailHelp">
        <div id="emailHelp" class="form-text">We'll never share your email with anyone else.</div>
      </div>
      <div class="mb-3">
        <label for="exampleInputPassword1" class="form-label">Password</label>
        <input type="password" class="form-control" name="password" id="exampleInputPassword1">
      </div>
      <div class="mb-3 form-check">
        <input type="checkbox" class="form-check-input" id="exampleCheck1">
        <label class="form-check-label" for="exampleCheck1">Check me out</label>
      </div>
      <button type="submit" class="btn btn-primary">Submit</button>
    </form>
</div>    
    <?php require"footer.php";?>
   

</body>
</html>

Comments

Popular posts from this blog

Petroleum