-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate.php
58 lines (50 loc) · 1.92 KB
/
create.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
include 'connect.php';
if(isset($_POST['submit'])){
$Username = $_POST['username'];
$Email= $_POST['email'];
$Password= $_POST['password'];
$Phoneno= $_POST['phone'];
$sql= "INSERT INTO `operations`(`sno`, `username`, `email`, `password`, `phoneno`) VALUES ('','$Username','$Email','$Password','$Phoneno')";
$result = mysqli_query($con, $sql);
if($result){
// echo "data submtted sucessufully";
header("location:read.php");
}
else{
echo "data not submitted";
}
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>CRUD OPERATION</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container my-5">
<form method="post">
<div class="mb-3">
<label>Username</label>
<input type="text" class="form-control" placeholder= "Enter your username" name="username" autocomplete="off">
</div>
<div class="mb-3">
<label>Email</label>
<input type="email" class="form-control" placeholder="Enter your email" name="email" autocomplete="off">
</div>
<div class="mb-3">
<label>Password</label>
<input type="password" class="form-control" placeholder="Enter your password" name="password" autocomplete="off">
</div>
<div class="mb-3">
<label>Phone Number</label>
<input type="text" class="form-control" placeholder="Enter your phone number" name="phone" autocomplete="off">
</div>
<button type="submit" class="btn btn-primary" name="submit">Submit</button>
</form>
</div>
</body>
</html>