index.php
<DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="css.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,
initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.
1.3/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.
1.3/dist/js/bootstrap.bundle.min.js"></script>
</head>
<title>Hancie Phago</title>
<body>
<div class="container">
<form class="mb-3 mt-3" action="result.php" method="post">
<div class="row">
<div class="col">
<tr>
<td class="form-label">Username:</td>
<td><input type="text" name="username" class="form-control"
placeholder="Username"></td> </br>
</tr>
<tr>
<td class="form-label">Email:</td>
<td><input type="email" name="email" class="form-control"
placeholder="Email"></td> </br>
</tr>
</div>
<div class="col">
<tr>
<td class="form-label">Name:</td>
<td><input type="text" name="name" class="form-control"
placeholder="Name"></td></br>
</tr>
<tr>
<td class="form-label">Address</td>
<td><input type="text" class="form-control"
placeholder="Address" name="address"></td>
</tr>
</div>
<div class="mt-3">
<tr>
<td><input type="submit" class="btn btn-primary" value="Submit">
</tr>
</div>
</form>
</div>
</body>
</html>
result.php
<?php
if(empty($_POST['email'])){
echo "Email is required";
}
else {
$email=$_POST['email'];
$pattern="FILTER_VALIDATE_EMAIL";
echo preg_match($pattern,$email);
}
?>