-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.php
183 lines (121 loc) · 5.6 KB
/
login.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
174
175
176
177
178
179
180
181
182
183
<?php
error_reporting(E_ERROR | E_PARSE);
session_destroy();
session_start();
header('Content-type: text/html; charset=utf-8');
$script_root = substr(__FILE__, 0,
strrpos(__FILE__,
DIRECTORY_SEPARATOR)
).DIRECTORY_SEPARATOR;
@require 'medoo.php';
@require('config.php');
if ($_POST['delete']) {
unset($_POST);
}
$action = '';
if ($_POST["login"]) {
$name = $_POST["name"];
$email = $_POST["email"];
$password = $_POST["password"];
$repassword = $_POST['repassword'];
$name = stripslashes($name);
$email = stripcslashes($email);
$password = stripcslashes($password);
$repassword = stripcslashes($repassword);
if(!ctype_alnum($name)) {
$fehler['name'] = "<font color=#cc3333>Please enter your <strong>name</strong>.<br /></font>";
}
if (!preg_match("/^[0-9a-zA-ZÄÜÖ_.-]+@[0-9a-z.-]+\.[a-z]{2,6}$/", $email)) {
$fehler['email'] = "<font color=#cc3333>Please enter a <strong>e-mail-address</strong>.\n<br /></font>";
}
if(!$password){
$fehler['password'] = "<font color=#cc3333>Please enter your Password.\n<br /></font>";
}
if(strlen($password)<8){
$fehler['password'] = "<font color=#cc3333>Password too short.\n<br /></font>";
}
if($repassword != $password){
$fehler['repassword'] = "<font color=#cc3333>The pasword is not matching.\n<br /></font>";
}
$database = new medoo([
'database_type' => 'mysql',
'database_name' => $dbname,
'server' => $servername,
'username' => $username,
'password' => $dbpassword
]);
//$datas = $database->select("tmpapplicant", "*");
$countuser = $database->count("applicant", ["username" => $name ]);
if($countuser>0){
$fehler['name'] = "<font color=#cc3333><strong>User Name</strong> already exists..<br /></font>";
}
$countemail = $database->count("tmpapplicant",["email" => $email]);
if($countemail > 0){
$fehler['email'] = "<font color=#cc3333><strong>e-mail-address</strong> already exists.\n<br /></font>";
}
if(!isset($fehler)){
//echo "done";
//include("validatelogin.php");
$action = "upload.php";
$passwordhash = md5($password);
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de-DE" lang="de-DE">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="language" content="us"/>
<meta name="description" content="begc.co.in"/>
<meta name="robots" content="INDEX,FOLLOW"/>
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<title>Begc Step 1: Registration </title>
<link href="style-contact-form.css" rel="stylesheet" type="text/css" />
<script type='text/javascript'>
var action = '<?php echo $action; ?>';
function submittonext() {
if(action == '') {
return;
}
document.getElementById("myForm").submit();
}
</script>
<body id="Kontaktformularseite" onload="submittonext()">
<div class="kontaktformular" >
<center><img style="float: auto; text-align: center" src="font/logo.png" alt="Bio-Chemic Education Grant Commission, Govt. of India"/></center>
<center>Bakshi Lane, Bowbazar, P.O: Krishnanagar, Dist.: Nadia, W.B -741101</center>
<form action="<?php echo $action; ?>" method="post" id ='myForm' name="myForm" >
<fieldset class="kontaktdaten">
<legend>Step 1: User Registration</legend>
<table>
<tr>
<td class="label"><label>Username: <span class="pflichtfeld">*</span></label></td>
<td class="field"> <?php if ($fehler["name"] != "") { echo $fehler["name"]; } ?><input type="text" name="name" maxlength="25" id="textfield" value="<?php echo $_POST[name]; ?>" size="20" <?php if ($fehler["name"] != "") { echo 'class="errordesignfields"'; } ?>/></td>
</tr>
<tr>
<td class="label"><label>E-mail ID: <span class="pflichtfeld">*</span></label></td>
<td class="field"><?php if ($fehler["email"] != "") { echo $fehler["email"]; } ?><input type="text" name="email" maxlength="200" value="<?php echo $_POST[email]; ?>" size="20" <?php if ($fehler["email"] != "") { echo 'class="errordesignfields"'; } ?>/></td>
</tr>
<tr>
<td class="label"><label>Password: <span class="pflichtfeld">*</span></label></td>
<td class="field"><?php if ($fehler["password"] != "") { echo $fehler["password"]; } ?><input type="password" name="password" maxlength="200" value="" size="20" <?php if ($fehler["password"] != "") { echo 'class="errordesignfields"'; } ?>/></td>
</tr>
<tr>
<td class="label"><label>Re-enter Password: <span class="pflichtfeld">*</span></label></td>
<td class="field"><?php if ($fehler["repassword"] != "") { echo $fehler["repassword"]; } ?><input type="password" name="repassword" maxlength="200" value="" size="20" <?php if ($fehler["repassword"] != "") { echo 'class="errordesignfields"'; } ?>/></td>
</tr>
</table>
</fieldset>
<fieldset class="buttons">
<legend>your action</legend>
Remember the password, this will allow you to login to the system later.</br>
<input type="hidden" name="passwordhash" value="<?php echo $passwordhash;?>" />
<input type="submit" name="login" value="Submit" />
<input type="submit" name="delete" value="Delete" />
</fieldset>
</form>
<div style="font-size:11px; text-align:center"><!-- It´s not allowed to remove the copyright notice! --><strong>Copyright</strong>: © 2015 - 2020 <a href="http://www.begc.co.in/" title="Contact Form"> Bio-chemic Education Grant Commission, Govt of India. </a> </div>
</div>
</body>
</html>