forked from WorkofAditya/PHP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathINSERT.PHP
More file actions
39 lines (33 loc) · 1022 Bytes
/
INSERT.PHP
File metadata and controls
39 lines (33 loc) · 1022 Bytes
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
<?php
include 'db.php';
if(isset($_POST['submit']))
{
$FRISTNAME= $_POST['firstname'];
$LASTNAME= $_POST['lastname'];
$DIVISON= $_POST['division'];
$EMAILID = $_POST['email'];
$AGE= $_POST['age'];
mysqli_query ($conn,"INSERT INTO classinfo (FRISTNAME, LASTNAME, DIVISON, EMAILID , AGE )VALUES (' $FRISTNAME', '$LASTNAME', '$DIVISON ', '$EMAILID', $AGE )");
echo "Record added successfully!";
header("location index.php");
}
?>
<html>
<body>
<form method="POST" action="index.php">
<b> student info from</b>
ID <input name="id"><br><br>
First Name <input type="text" name="firstname"><br><br>
Last Name <input type="text" name="lastname"><br><br>
Division <input type="text" name="division"><br><br>
Email <input type="text" name="email"><br><br>
Age <input type="text" name="age"><br><br>
<style>
body {
background-color: green;
}
</style>
<input type="submit" name="submit" >
</form>
</body>
</html>