-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathformcss.php
More file actions
131 lines (110 loc) · 3.19 KB
/
formcss.php
File metadata and controls
131 lines (110 loc) · 3.19 KB
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?php
// CREATE TABLE userdb ( id INT AUTO_INCREMENT PRIMARY KEY, first_name VARCHAR(50), last_name VARCHAR(50), email VARCHAR(100) UNIQUE, mobile VARCHAR(15), age INT );
// include ("connection.php");
$con=mysqli_connect("localhost","root","","shailesh","3306");
if($con){
// echo "database connected";
}else{
echo "disconnect";
}
if(!empty($_POST['first_name']))
{
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$email = $_POST['email'];
$mobile = $_POST['mobile'];
$age = $_POST['age'];
// Insert into database
$sql = "INSERT INTO userdb (first_name, last_name, email, mobile, age)
VALUES ('$first_name', '$last_name', '$email', '$mobile', '$age')";
$rs=mysqli_query($con,$sql);
if($rs)
{
// echo"Record has been added successfully";
}
else
{
echo"Failed to add record";
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Document</title>
</head>
<style>
body{
background-color: lightseagreen;
background-image: url(https://idsb.tmgrup.com.tr/ly/uploads/images/2021/05/30/118050.jpg);
background-repeat: no-repeat;
background-size: cover;
}
div{
border-radius: 30px;
width: 40%;
font-size: xx-large;
display: flex;
flex-direction: column;
align-items: center;
color: white;
box-shadow: black 10px 20px 10px;
}
input{
width: 300px;
height: 40px;
border: 3px black solid;
border-radius: 50px;
font-size: large;
text-align: center;
}
td{
padding-bottom: 40px;
}
::placeholder{
font-size: large;
padding-left: 60px;
color: black;
}
label{
font-size: large;
margin: 10px;
color: white;
}
td label {
font-size: 22px;
}
</style>
<body>
<div>
<h1>Login Form</h1>
<form method="post">
<table>
<tr>
<td><label for="na">First_Name</label></td>
<td><input type="text" id="na" name="first_name" placeholder="Enter your first name"></td>
</tr>
<tr>
<td><label for="na">Last_Name</label></td>
<td><input type="text" id="na" name="last_name"placeholder="Enter your last name"></td>
</tr>
<tr>
<td><label for="em">Email</label></td>
<td><input type="email" id="em" name="email" placeholder="enter your email"></td>
</tr>
<tr>
<td><label for="mo">Mobile</label></td>
<td><input type="number" id="mo" name="mobile" placeholder="enter your mobile no."></td>
</tr>
<tr>
<td><label for="nu">Age</label></td>
<td><input type="number" id="nu" name="age"placeholder="enter your age"></td>
</tr>
<tr>
<td><input type="submit" name="submit" value="ADD"></td>
</tr>
</table>
</form>
</div>
</body>
</html>