-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathadd_member.php
More file actions
155 lines (123 loc) · 3.46 KB
/
add_member.php
File metadata and controls
155 lines (123 loc) · 3.46 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>member registration</title>
<link rel="stylesheet" type="text/css" href="screen.css" media="screen" />
</head>
<body>
<div id="header">
<img src="logo.png" name="logo" align="middle" />
<p id="layoutdims"><marquee>Welcome to Online Library Management System</marquee></p>
</div>
<div class="colmask threecol">
<div class="colmid">
<div class="colleft">
<div class="col1">
<!-- Column 1 start -->
<h1 align="center" > <font color="#369">MEMBER REGISTRATI0N</font></h1><br><br>
<table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<form name="form1" method="post" action="">
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF" >
<tr>
<td width="78"><B>Name</B></td>
<td width="6">:</td>
<td width="294"><input name="name" type="text"></td>
</tr>
<tr>
<td width="78"><B>Roll no</B></td>
<td width="6">:</td>
<td width="294"><input name="mid" type="text"></td>
</tr>
<tr>
<td width="78"><B>Email</B></td>
<td width="6">:</td>
<td width="294"><input name="email" type="email"></td>
</tr>
<tr>
<td><B>Password</B></td>
<td>:</td>
<td><input name="pass" type="password"></td>
</tr>
<tr>
<td><B>Branch</B></td>
<td>:</td>
<td><input name="branch" type="text"></td>
</tr>
<tr>
<td><B>Year</B></td>
<td>:</td>
<td><input name="year" type="text"></td>
</tr>
<tr>
<td width="78"><B>Contact no</B></td>
<td width="6">:</td>
<td width="294"><input name="contactno" type="tel"></td>
</tr>
<tr>
<td width="78"><B>Address</B></td>
<td width="6">:</td>
<td width="294"><textarea rows="4" cols="22" name="address" ></textarea></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="submit" value="Create"><a href=""></td>
<td><font color="#6CB5FF"></font>
<input type="submit" name="reset" value="Reset"><a href=""></td>
<td><font color="#6CB5FF"></font></td>
</table>
</td>
</form>
<?php
if(isset($_POST["submit"])){
if(!empty($_POST['name']) && !empty($_POST['pass']) && !empty($_POST['mid']) && !empty($_POST['email']) && !empty($_POST['branch']) && !empty($_POST['year'])&& !empty($_POST['contactno']) && !empty($_POST['address'])) {
$name=$_POST['name'];
$mid=$_POST['mid'];
$email=$_POST['email'];
$pass=$_POST['pass'];
$branch=$_POST['branch'];
$year=$_POST['year'];
$contact=$_POST['contactno'];
$address=$_POST['address'];
include 'conn.php';
$query=$mysqli->query("SELECT * FROM member WHERE Mid='".$mid."'");
$numrows=$query->num_rows;
if($numrows==0)
{
$sql="INSERT INTO member(Name,Mid,Email,Password,Branch,Year,ContactNo,Address) VALUES('$name','$mid','$email','$pass','$branch','$year','$contact','$address')";
$result=$mysqli->query($sql);
}
else
{
echo "That username already exists! Please try again with another.";
}
}
else
{
echo "All fields are required!";
}
header ('location:admin.php');
}
?>
</tr>
</table><br><br><br><br><br><br><br>
<!-- Column 1 end -->
</div>
<div class="col2">
<!-- Column 2 start -->
<!-- Column 2 end -->
</div>
<div class="col3">
<!-- Column 3 start -->
<div id="ads">
</div>
<!-- Column 3 end -->
</div>
</div>
</div>
</div>
<div id="footer">
</div>
</body>
</html>