-
Notifications
You must be signed in to change notification settings - Fork 0
/
register1.php
141 lines (130 loc) · 7.12 KB
/
register1.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
<?php
include_once('dbFunction.php');
error_reporting(0);
$funObj = new dbFunction();
if($_POST['login']){
$emailid = $_POST['emailid'];
$password = $_POST['password'];
$user = $funObj->Login($emailid, $password);
if ($user) {
// Registration Success
header("location:survey.php");
} else {
// Registration Failed
echo "<script>alert('Emailid / Password Not Match')</script>";
}
}
if($_POST['register']){
$username = $_POST['username'];
$emailid = $_POST['emailid'];
$password = $_POST['password'];
$ngo = $_POST['ngo_name'];
$city = $_POST['city_name'];
$confirmPassword = $_POST['confirm_password'];
if($password == $confirmPassword){
$email = $funObj->isUserExist($emailid);
if(!$email){
$register = $funObj->UserRegister($username, $emailid, $password, $ngo, $city);
if($register){
echo "<script>alert('Registration Successful')</script>";
}else{
echo "<script>alert('Registration Not Successful')</script>";
}
} else {
echo "<script>alert('Email Already Exist')</script>";
}
} else {
echo "<script>alert('Password Not Match')</script>";
}
}
?>
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta charset="UTF-8" />
<title>Login and Registration Form with HTML5 and CSS3</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Login and Registration Form with HTML5 and CSS3" />
<meta name="keywords" content="html5, css3, form, switch, animation, :target, pseudo-class" />
<meta name="author" content="Codrops" />
<link rel="shortcut icon" href="../favicon.ico">
<link rel="stylesheet" type="text/css" href="css/demo.css" />
<link rel="stylesheet" type="text/css" href="css/style2.css" />
<link rel="stylesheet" type="text/css" href="css/animate-custom.css" />
</head>
<body>
<div class="container">
<header>
<h1>Login and Registration Form </h1>
</header>
<section>
<div id="container_demo" >
<a class="hiddenanchor" id="toregister"></a>
<a class="hiddenanchor" id="tologin"></a>
<div id="wrapper">
<div id="login" class="animate form">
<form name="login" method="post" action="">
<h1>Log in</h1>
<p>
<label for="emailsignup" class="youmail" data-icon="e" > Your email</label>
<input id="emailsignup" name="emailid" required="required" type="email" placeholder="mysupermail@mail.com"/>
</p>
<p>
<label for="password" class="youpasswd" data-icon="p"> Your password </label>
<input id="password" name="password" required="required" type="password" placeholder="eg. X8df!90EO" />
</p>
<p class="keeplogin">
<input type="checkbox" name="loginkeeping" id="loginkeeping" value="loginkeeping" />
<label for="loginkeeping">Keep me logged in</label>
</p>
<p class="login button">
<input type="submit" name="login" value="Login" />
</p>
<p class="change_link">
Not a member yet ?
<a href="#toregister" class="to_register">Join us</a>
</p>
</form>
</div>
<div id="register" class="animate form">
<form name="login" method="post" action="">
<h1> Sign up </h1>
<p>
<label class="youpasswd" data-icon="p">NGO Name</label>
<input id="passwordsignup_confirm" name="ngo_name" required="required" placeholder="eg.Happy hearts"/>
</p>
<p>
<label class="youpasswd" data-icon="p">City Name</label>
<input id="passwordsignup_confirm" name="city_name" required="required" placeholder="eg.Mumbai"/>
</p>
<p>
<label for="usernamesignup" class="uname" data-icon="u">Your username</label>
<input id="usernamesignup" name="username" required="required" type="text" placeholder="mysuperusername690" />
</p>
<p>
<label for="emailsignup" class="youmail" data-icon="e" > Your email</label>
<input id="emailsignup" name="emailid" required="required" type="email" placeholder="mysupermail@mail.com"/>
</p>
<p>
<label for="passwordsignup" class="youpasswd" data-icon="p">Your password </label>
<input id="passwordsignup" name="password" required="required" type="password" placeholder="eg. X8df!90EO"/>
</p>
<p>
<label for="passwordsignup_confirm" class="youpasswd" data-icon="p">Please confirm your password </label>
<input id="passwordsignup_confirm" name="confirm_password" required="required" type="password" placeholder="eg. X8df!90EO"/>
</p>
<p class="signin button">
<input type="submit" name="register" value="Sign up"/>
</p>
<p class="change_link">
Already a member ?
<a href="#tologin" class="to_register"> Go and log in </a>
</p>
</form>
</div>
</div>
</div>
</section>
</div>
</body>
</html>