-
Notifications
You must be signed in to change notification settings - Fork 0
/
user.php
70 lines (51 loc) · 1.74 KB
/
user.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
59
60
61
62
63
64
65
66
67
68
69
70
<?php
include 'connect.php';
if(isset($_POST['submit'])){
$name = $_POST['name'];
$email = $_POST['email'];
$mobile = $_POST['mobile'];
$password = $_POST['password'];
$sql = "insert into `crud` (name,email,mobile,password)
values('$name','$email','$mobile','$password')";
$result = mysqli_query($con,$sql);
if($result){
// echo "data inserted";
header("location:display.php");
}else{
die(mysqli_error($con));
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Add user page</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
</head>
<body>
<div class="container mt-5">
<h1 class="text-center ">Add details</h1>
<form method="post">
<div class="mb-3">
<label class="form-label">Name </label>
<input type="name" name="name" class="form-control" autocomplete="off" >
</div>
<div class="mb-3">
<label class="form-label">Email </label>
<input type="email" name="email" class="form-control"autocomplete="off" >
</div>
<div class="mb-3">
<label class="form-label">Mobile </label>
<input type="number" name="mobile" class="form-control" autocomplete="off" >
</div>
<div class="mb-3">
<label class="form-label">Password</label>
<input type="password" name="password" class="form-control" autocomplete="off" >
</div>
<button type="submit" class="btn btn-primary" name="submit">Add User</button>
</form>
</div>
</body>
</html>