-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcodebuckets_signup.php
173 lines (168 loc) · 5.21 KB
/
codebuckets_signup.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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<?php
session_start();
include 'database2.php';
if (isset($_POST['submit']))
{
$email=$_POST['email'];
$password=$_POST['password'];
$cpassword=$_POST['cpassword'];
$country=$_POST['country'];
$gender=$_POST['gender'];
$organization=$_POST['organization'];
if($password==$cpassword){
$query=mysql_query("SELECT email from projectform where email='$email'");
$n=mysql_num_rows($query);
if($n==0)
{
$q=mysql_query("INSERT into projectform(email,password,country,gender,organization) VALUES('$email','$password','$country','$gender','$organization')");
if($q)
{
echo "success";
$_SESSION['email']=$email;
}
else {
echo "fail";
}}
/* else{
$q=mysql_query("UPDATE tableform set password='$password',gender='$gender',state='$state' where email='$email'");
if ($q)
{
echo "updated";
}
else
{
echo "update failed";
}
}*/
}
else{
echo "password doesn't match";
}
}
if (isset($_POST['submit1']))
{
$email=$_POST['email'];
$password=$_POST['password'];
$query=mysql_query("SELECT * from projectform where email='$email' ");
$n=mysql_num_rows($query);//retrieves a number of rows from a result set
if($n==1)
{
$row=mysql_fetch_assoc($query);//corresponds to the fetched row,and moves the internal data pointer ahead;
if ($password==$row['password'])
{
echo "Success";
header("refresh:1;url=codebuckets1.php");}
else
{
echo "failure!";
}
}
else {
echo "email doesn't Exist!";
}
}
?>
<!DOCTYPE html>
<html>
<head>
<style>
body{
font-size:20px;
border:40px 40px 40px 40px;
border-style: dotted;
background: #f6f5f7;
}
.column {
float: left;
width: 50%;
/* padding: 10px;*/
height: 600px; /* Should be removed. Only for demonstration */
}
/* Clear floats after the columns */
.row:after {
content: "";
display: table;
clear: both;
}
</style>
</head>
<center><body>
<h1 style="background-color:grey;">The Data Journalists</h1>
<div class="row">
<div class="column" style="background-color:#9e363a;">
<form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
<table style="width:100%">
<tr>
<th style="text-align:left">Sign Up credentials</th>
<th style="text-align:left">Your Info</th>
</tr>
<tr>
<td>Email:</td>
<td><input type="email" required placeholder="Enter a valid e-mail id" name="email"></td>
</tr>
<tr>
<td>Country:</td>
<td><select name="country">
<option value="" >select country</option>
<option value="india">India</option>
<option value="america">America</option>
<option value="britain">Britain</option>
<option value="pakistan">Pakistan</option>
<option value="canada">Canada</option>
<option value="restofworld">Rest Of World</option>
</select></td>
</tr>
<tr>
<td>Present Organisation:</td>
<td> <select name="organization">
<option value="" >select your organization</option>
<option value="thehindu">The Hindu</option>
<option value="washingtonpost">The Washington Post</option>
<option value="guardian">The Guardian</option>
<option value="dawn">The Dawn</option>
<option value="reutersw">The Reuters</option>
<option value="aljajeera">Al_Jajeera</option>
</select></td>
</tr>
<tr>
<td>Gender:</td>
<td> <select name="gender">
<option value="" >select Gender</option>
<option value="male">Male</option>
<option value="female">Female</option>
<option value="disclose">Rather Not Say</option>
</select></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" required placeholder="Enter your password" name="password"></td>
</tr>
<tr>
<td>Confirm Password:</td>
<td><input type="password" placeholder="Confirm Password" id="confirm_password" name="cpassword" required></td>
</tr>
</table>
<center><h1><button type="submit" name="submit" >Submit</button></h1></center>
</form>
</div>
<div class="column" style="background-color:#00a0a0;">
<form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
<table style="width:100%">
<tr>
<th style="text-align:left">Login credentials</th>
<th style="text-align:left">Login Info</th>
</tr>
<tr>
<td>Email:</td>
<td><input type="email" required placeholder="Enter a valid e-mail id" name="email"></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" required placeholder="Enter your password" name="password"></td>
</tr>
</table>
<center><button type="submit" name="submit1">Submit</button></center></form>
</div>
</div>
</body></center>
</html>