Project Final
Project Final
html:
<!DOCTYPE html>
<html>
<head>
<title>Database Operations</title>
<meta charset="UTF-8">
<style>
body {
background-image: url('https://png.pngtree.com/background/20210709/original/pngtree-
technology-sense-smart-lock-advertising-background-picture-image_960160.jpg');
background-size: cover;
background-position: center;
form {
max-width: 400px;
margin: 0 auto;
padding: 40px;
border-radius: 8px;
background-image: url("https://media.istockphoto.com/id/1223914421/vector/abstract-blue-
wave-background.jpg?s=612x612&w=0&k=20&c=W8IAWjODYdStfbZXxqdG-
ovDG2rWjRehnlrQCw1eDn0=");
h1 {
text-align: center;
margin-bottom: 30px;
color: #333333;
max-width: 400px;
margin: 0 auto;
padding: 40px;
border-radius: 8px;
background-image:
url("https://st4.depositphotos.com/20524830/25837/i/600/depositphotos_258375388-stock-photo-
abstract-blue-nature-soft-blurred.jpg");
label {
display: block;
margin-bottom: 10px;
color: #555555;
.container{
border-radius: 4px;
box-sizing: border-box;
margin-left: 30%;
margin-right: 30%;
padding:5px;
max-width: available;
background-image:
url("https://i.pinimg.com/originals/5a/65/37/5a653708fd9248867cb90a09919a40e8.jpg");
input[type="text"],
input[type="number"],
input[type="email"],
select {
width: 100%;
padding: 12px;
margin-bottom: 20px;
border-radius: 4px;
box-sizing: border-box;
font-size: 16px;
background-color: #f9f9f9;
input[type="submit"] {
background-color: #4CAF50;
color: #ffffff;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
input[type="submit"]:hover {
background-color: #45a049;
</style>
</head>
<body>
<div class="container">
<h1>DataBase Operations</h1>
<br>
<select name="choice">
<option>Create table</option>
</select>
<label for="name">Name:</label>
<label for="dept">Department:</label>
<select name="dept">
<option>IT</option>
<option>CT</option>
<option>AUTO</option>
<option>RPT</option>
<option>PT</option>
<option>ECE</option>
<option>E&I</option>
<option>AERO</option>
</select>
<label for="email">Email:</label>
</form>
</div>
</body>
</html>
newEmptyPHP.php:
<!DOCTYPE html>
<html>
<head>
<title>Database Operations</title>
<style>
body {
margin: 0;
padding: 20px;
background-image: url('https://png.pngtree.com/background/20210709/original/pngtree-
technology-sense-smart-lock-advertising-background-picture-image_960160.jpg');
background-size: 150%;
background-position: center;
}
.container {
max-width: 500px;
margin: 0 auto;
padding: 20px;
border-radius: 5px;
background-image:
url("https://st4.depositphotos.com/20524830/25837/i/600/depositphotos_258375388-stock-photo-
abstract-blue-nature-soft-blurred.jpg");
.result {
margin-top: 20px;
background-color: #f9f9f9;
padding: 10px;
border-radius: 3px;
background-image: url("https://media.istockphoto.com/id/1223914421/vector/abstract-blue-
wave-background.jpg?s=612x612&w=0&k=20&c=W8IAWjODYdStfbZXxqdG-
ovDG2rWjRehnlrQCw1eDn0=");
.error {
color: red;
padding: 10px;
border-radius: 3px;
background-image: url("https://media.istockphoto.com/id/1223914421/vector/abstract-blue-
wave-background.jpg?s=612x612&w=0&k=20&c=W8IAWjODYdStfbZXxqdG-
ovDG2rWjRehnlrQCw1eDn0=");
</style>
</head>
<body>
<div class="container">
<?php
extract($_POST);
$dbname = $dbname;
$tname = $tname;
$choice = $choice;
$reg = $reg;
$name = $name;
$dept = $dept;
$phnum = $phnum;
$email = $email;
$host = "localhost";
$user = "root";
if($phnum!=""){
if(strlen($phnum)!=10){
exit;
} else {
$conn->close();
} elseif ($choice == "Insert record in table") {
} else {
$conn->close();
} else {
$conn->close();
$result = $conn->query($sql);
if ($result->num_rows > 0) {
echo '</div>';
}
} else {
$conn->close();
} else {
$conn->close();
?>
</div>
</body>
</html>
Table Creation :
Validation of Phone Number :
If "Insert record in Table" option was selected :
If "Update record in Table" option was selected :
If "Delete record in Table " option was selected :
If "Display all records " option was selected :