-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy paths_nw.php
147 lines (123 loc) · 3.18 KB
/
s_nw.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
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<?php
session_start();
$host = "localhost";
$user = "root";
$password = "";
$db = "ocr";
$con = new mysqli($host ,$user, $password, $db);
if ($con->connect_error) {
die("Connection failed: ".$con->connect_error);
}
if(empty($_SESSION['id']))
{
header("Location: lgn.php");
die("Redirecting to Login");
}
?>
<!DOCTYPE html>
<html>
<style>
input, select {
font-size: 15px;
width: 14%;
padding: 8px 20px;
margin: 2px 0;
border: 3px solid gray;
border-radius: 12px;
border-bottom: 2px solid blue;
background-color: #3CBC8D;
color: black;
-webkit-transition: width 0.4s ease-in-out;
transition: width 0.4s ease-in-out;
}
select:focus {
width: 25%;
border: 3px solid #555;
background-color: MediumAquaMarine;
}
input[type=submit]{
font-size: 20px;
font-family: franklin gothic;
padding: 5px 5px;
border: 3px solid gray;
border-radius: 12px;
width: 8%;
background-color: blue;
-webkit-transition: width 0.4s ease-in-out;
transition: width 0.4s ease-in-out;
cursor: pointer;
}
input:focus[type=submit]{
width: 16%;
border: 3px solid #555;
background-color: LightSeaGreen;
}
img {
display: block;
margin-left: auto;
margin-right: auto;
width: 10%;
}
</style>
</head>
<body style="background-color:darkred;">
<img src="CUET_logo.png" alt="cuet logo" width="104" height="142">
<h1 style="
text-align:center;
border:5px solid black;
border-radius: 8px;
padding: 12px;
margin: 50px;
font-size:40px;
font-family:impact;
color:lightblue;
">Add New Student Data</h1>
<br> <br>
<form
style="text-align:center; color: Chartreuse;"
action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"
target="_self"
method="POST"
>
ID:<br>
<input type="number" name="sid"><br>
Password:<br>
<input type="text" name="sps"><br>
Name:<br>
<input type="text" name="snm"><br>
E-Mail:<br>
<input type="text" name="sml"><br>
Mobile No.:<br>
<input type="number" name="smbl"><br>
Father:<br>
<input type="text" name="fnm"><br>
Mobile No.:<br>
<input type="number" name="fmbl"><br>
Mother:<br>
<input type="text" name="mnm"><br>
Address:<br>
<input type="text" name="adr"><br>
Hall:<br>
<input type="text" name="hl"><br>
Seat:<br>
<input type="text" name="htp"><br>
Grade:<br>
<input type="text" name="grd"><br>
Advisor ID:<br>
<input type="number" name="avid"><br>
Admin ID:<br>
<input type="number" name="amid"><br>
Approval:<br>
<input type="number" name="aprv"><br>
<input type="submit" name="sub" value="Add">
</form>
<?php
if (isset($_POST['sub']))
{
$sql= "insert into student values ('".$_POST['sid']."', '".$_POST['sps']."', '".$_POST['snm']."', '".$_POST['sml']."', '".$_POST['smbl']."', '".$_POST['fnm']."', '".$_POST['fmbl']."', '".$_POST['mnm']."', '".$_POST['adr']."', '".$_POST['hl']."', '".$_POST['htp']."', '".$_POST['grd']."', '".$_POST['avid']."', '".$_POST['amid']."', '".$_POST['aprv']."')";
$rslt = $con->query($sql);
header('location: admin.php');
}
?>
</body>
</html>