Skip to content

Commit f2aebf7

Browse files
authored
Add files via upload
0 parents  commit f2aebf7

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

db_value_enter.php

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?php require 'php database connection.php'; ?>
2+
<!DOCTYPE html>
3+
<html lang="en">
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
8+
<title>Document</title>
9+
</head>
10+
<body>
11+
<form action="" method="POST">
12+
<table>
13+
<tr>
14+
<td>Name</td>
15+
<td><input type="text" name="e_name" require></td>
16+
</tr>
17+
<tr>
18+
<td>Email</td>
19+
<td><input type="email" name="e_email" require></td>
20+
</tr>
21+
<tr>
22+
<td>Phone</td>
23+
<td><input type="tel" name="e_phone" require></td>
24+
</tr>
25+
<tr>
26+
<td></td>
27+
<td><input type="submit" name="e_add" require></td>
28+
</tr>
29+
</table>
30+
</form>
31+
<?php
32+
if(isset($_POST['e_add']))
33+
{
34+
$e_name = $_POST['e_name'];
35+
$e_email = $_POST['e_email'];
36+
$e_phone = $_POST['e_phone'];
37+
38+
$sql = "INSERT INTO employee (e_name,e_email,e_phone) VALUES ('$e_name','$e_email','$e_phone' )";
39+
40+
if(mysqli_query($conn,$sql))
41+
{
42+
echo "<script> alert ('Wow record created sucessfully');</script>";
43+
}
44+
else
45+
{
46+
echo "ERROR:" ,$sql . "<br/>", mysqli_error($conn);
47+
}
48+
}
49+
?>
50+
</body>
51+
</html>

0 commit comments

Comments
 (0)