-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathregform.html
100 lines (71 loc) · 2.27 KB
/
regform.html
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?php
include("connect.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>regform</title>
<link rel="stylesheet" href="regformstyle.css">
</head>
<body>
<form action="#" method="POST" >
<div class="container">
<div class="form">
<div class="ftitle">
<h3>Registration Form </h3>
</div>
<fieldset>
<div class="input-field">
<label>First name:</label>
<input type="text" placeholder="Enter first name" name="firstname" required>
</div>
<div class="input-field">
<label>Last name:</label>
<input type="text" placeholder="Enter last name" name="lastname" required>
</div>
</fieldset>
<fieldset>
<div class="input-field">
<label> E-mail ID:</label>
<input type="email" placeholder="Enter Email" name="email" required>
</div>
</fieldset>
<fieldset>
<div class="input-field">
<label>Mobile:</label>
<input type="text" placeholder="Enter Mobile Number" name="phone" required>
</div>
<div class="input-field">
<label>Address:</label>
<textarea placeholder="Enter Address.."rows=3 cols="18" name="address"></textarea>
</div>
</fieldset>
<input type="submit" value="Submit" name="sub">Submit</input>
</div>
<p> Already have an account? <span><a href="#">Sign in</a></span></p>
</div>
</form>
</body>
</html>
<?php
if($_POST['sub'])
{
$firstname = $_POST['fname'];
$lastname = $_POST['lname'];
$email = $_POST['mail'];
$phone = $_POST['phn'];
$address = $_POST['add'];
$query = "INSERT INTO REGDB VALUES('$firstname','$lastname' ,'$email','$phone','$address')";
$data = mysqli_query($conn,$query);
if($data)
{
echo "data inserted";
}
else{
echo "failed";
}
}
?>