-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinsert.php
73 lines (62 loc) · 2.71 KB
/
insert.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
71
72
73
<?php
if(isset($_POST["submit"]))
{
$empno = $_POST["empno"];
$name = $_POST["name"];
$email = $_POST["email"];
$salary = $_POST["salary"];
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Dashboard-Insert</title>
<link rel="stylesheet" href="style.css">
<script src="https://code.jquery.com/jquery-3.7.1.js" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4=" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css" integrity="sha512-Kc323vGBEqzTmouAECnVceyQqyqdsSiqLQISBL29aUW4U/M7pSPA/gEUZQqv1cwx4OnYxTxve5UMg5GT6L4JJg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
</head>
<body>
<?php
include "include/navbar.php";
?>
<div id="hero">
<?php
if(isset($_POST["submit"]))
{
$con = new mysqli("localhost","root","","suraj");
$qry = "insert into employee(empno,name,email,salary) values('$empno','$name','$email','$salary')";
$con->query($qry);
$con->close();
header("location: update.php");
echo "<script>";
echo "alert('data saved Successfull!!')";
echo "</script>";
}
?>
<form method="post" action="insert.php" id="form">
<h4>Insert Employee Details</h4>
<div class="form-group">
<input type="text" class="form-control" placeholder="Enter employee no." name="empno">
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="Enter name" name="name">
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="Enter email" name="email">
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="Enter salary" name="salary">
</div>
<button type="submit" name="submit" class="form-control" style="background-color: deepskyblue; font-weight:bold">Submit</button>
</form>
</div>
<?php
include "include/footer.php";
?>
<script src="script.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
</body>
</html>