-
Notifications
You must be signed in to change notification settings - Fork 1
/
registration.php
155 lines (141 loc) · 4.38 KB
/
registration.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
<?php
include "connect.php";
session_start();
if(isset($_SESSION['u_name'])){
echo '
<script type = "text/javascript">
alert("ALREADY LOGED-IN");
window.location = "index.php";
</script>
';
} else {
require_once "header1.php";
?>
<!--header//-->
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script><!-- jQuery Library-->
<link rel="stylesheet" href="css/passwordscheck.css" /><!-- Include Your CSS file here-->
<script>
function showResult(str) {
if (str.length==0) {
document.getElementById("livesearch").innerHTML="";
document.getElementById("livesearch").style.border="0px";
return;
}
if (window.XMLHttpRequest) {
// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
} else { // code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function() {
if (this.readyState==4 && this.status==200) {
document.getElementById("livesearch").innerHTML=this.responseText;
document.getElementById("livesearch").style.border="0px solid #A5ACB2";
}
}
xmlhttp.open("GET","getuser.php?q="+str,true);
xmlhttp.send();
}
</script>
<script>
$(document).ready(function() {
$('#password').keyup(function() {
$('#result').html(checkStrength($('#password').val()))
})
function checkStrength(password) {
var strength = 0
if (password.length < 6) {
$('#result').removeClass()
$('#result').addClass('short')
return 'Too short'
}
if (password.length > 7) strength += 1
// If password contains both lower and uppercase characters, increase strength value.
if (password.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)) strength += 1
// If it has numbers and characters, increase strength value.
if (password.match(/([a-zA-Z])/) && password.match(/([0-9])/)) strength += 1
// If it has one special character, increase strength value.
if (password.match(/([!,%,&,@,#,$,^,*,?,_,~])/)) strength += 1
// If it has two special characters, increase strength value.
if (password.match(/(.*[!,%,&,@,#,$,^,*,?,_,~].*[!,%,&,@,#,$,^,*,?,_,~])/)) strength += 1
// Calculated strength value, we can return messages
// If value is less than 2
if (strength < 2) {
$('#result').removeClass()
$('#result').addClass('weak')
return 'Weak'
} else if (strength == 2) {
$('#result').removeClass()
$('#result').addClass('good')
return 'Good'
} else {
$('#result').removeClass()
$('#result').addClass('strong')
return 'Strong'
}
}
});
</script>
</head>
<div class="registration-form">
<div class="container">
<ol class="breadcrumb">
<li><a href="index.html">Home</a></li>
<li class="active">Registration</li>
</ol>
<h2>Registration</h2>
<div class="col-md-6 reg-form">
<div class="reg">
<p>Welcome, please enter the folling to continue.</p>
<p>If you have previously registered with us, <a href="login.php">click here</a></p>
<form action="i_new_user_details.php" method="POST">
<ul>
<li class="text-info">First Name: </li>
<li><input type="text" value="" name="fname"required=""></li>
</ul>
<ul>
<li class="text-info">Last Name: </li>
<li><input type="text" value="" name="lname"></li>
</ul>
<ul>
<li class="text-info">E-mail: </li>
<li><input type="text" value="" name="email"></li>
</ul>
<ul>
<li class="text-info">Your User Name: </li>
<li><input type="text" value="" name="u_name" onkeyup="showResult(this.value)"></li>
<div id="livesearch"></div>
</ul>
<br>
<ul>
<li class="text-info">Password: </li>
<li><input type="password" value="" id="password" name="password"></li>
<p style= "color:Green"> <span id="result"> Strength</span></p>
{Include:Special Characters, Numbers}
</ul>
<br>
<ul>
<li class="text-info">Mobile Number:</li>
<li><input type="text" value="" name="mobile_num"></li>
</ul>
<input type="submit" value="Register Now" name="submit">
<p class="click">By clicking this button, you agree to my modern style <a href="#">Pollicy Terms and Conditions</a> to Use</p>
</form>
</div>
</div>
<div class="col-md-6 reg-right">
<h3>Create Free Account</h3>
<p>Register Now. It's completely free</p>
</div>
<div class="clearfix"></div>
</div>
</div>
<!--fotter-->
<?php
require_once "men_footer.php";
}
?>
<!--fotter//-->
</body>
</html>