-
Notifications
You must be signed in to change notification settings - Fork 3
/
regster.php
107 lines (86 loc) · 2.66 KB
/
regster.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
<?php
if(isset($_POST["str"]))
{
include("common.php");
$con=mysqli_connect("localhost","te","123","tecomp");
$a=$_POST["nme"];
$b=$_POST["ui"];
$c=$_POST["pass"];
$d=$_POST["num"];
$e=$_POST["rd"];
if(empty($a)|empty($b)|empty($c)|empty($d)|empty($e))
{echo"<center><h3>All the Fields are Not Specified<br>Try Again!!!!!<br></h3></center>";}
else
{$m=$_POST['belongs'];
if($m=="mem"|$m=="invester")
{
$f=$_POST["fno"];
$s=$_POST["security"];
if(empty($f)|empty($s))
{echo "<center><h3>Flat no. or Authentication no. Not Entered<br />Try Again!!!</center><br><h3> ";}
else
{
$sql="SELECT authen FROM society WHERE flatno=$f";
$res=mysqli_query($con,$sql);
$row=mysqli_fetch_array($res,MYSQL_ASSOC);
if($s=="{$row["authen"]}")
{ $res=mysqli_query($con,"SELECT COUNT(*) FROM society WHERE pass='$c' OR uid='$b'");
$row=mysqli_fetch_array($res,MYSQL_ASSOC);
if("{$row["COUNT(*)"]}">0)
{echo "error";}
else{
$sql1="UPDATE society SET name='{$a}',uid='{$b}',pass='{$c}',phnno='{$d}',sex='{$e}',identity='{$m}' WHERE flatno=$f";
$res=mysqli_query($con,$sql1);
echo"<center><h3> Signup Successfull</h3></center><br><br>";
}
}
else
{echo"<center><h3>Authentication Failed<br /> Try Again!!!!</h3></center>";}
}}
else
{$p=NULL;
$res=mysqli_query($con,"SELECT COUNT(*) FROM society WHERE pass='$c' OR uid='$b'");
$row=mysqli_fetch_array($res,MYSQL_ASSOC);
$res1=mysqli_query($con,"SELECT COUNT(*) FROM other WHERE pass='$c' OR uid='$b'");
$row1=mysqli_fetch_array($res1,MYSQL_ASSOC);
if("{$row["COUNT(*)"]}">0)
{echo "error";}
else if("{$row["COUNT(*)"]}">0)
{echo "error";}
else{
echo"<center><h3> Signup Successfull</h3></center><br><br>";
$sql2="INSERT INTO other(name,uid,pass,phnno,sex) VALUES ('$a','$b','$c','$d','$e')";
$r=mysqli_query($con,$sql2);
if(!$r)
echo"error";
}
}
}
}
?>
<html>
<body>
<fieldset>
<center>
<font size="10">
<div class="form-style-5">
<form action="society.php" method="post">
<input type="submit" name="signup" value="SIGNUP AGAIN" align="right" style="height:60px; width:180px" >
</fieldset>
</form>
<fieldset>
<div class="form-style-5">
<form action="log.php" method="post">
<center><input type="submit" value="LOGIN" align="right" style="height:60px; width:120px" >
</font>
</form>
</fieldset>
<fieldset>
<div class="form-style-5">
<form action="main.php" method="post">
<center><input type="submit" value="MAIN PAGE" align="right" style="height:60px; width:200px" >
</font>
</fieldset>
</center>
</body>
</html>