-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_account.php
More file actions
135 lines (118 loc) · 3.12 KB
/
create_account.php
File metadata and controls
135 lines (118 loc) · 3.12 KB
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
<?php include "head.inc.php" ?>
<body>
<?php include "header.html" ?>
<div class = "container mt-3 pt-3">
<div class = "row">
<div class = "col-15 col-sm-15 col-md-30 m-auto">
<div class = "card-transparent">
<div class = "card-body">
<div class="card-body align-items-center d-flex justify-content-center">
<form class= ".login-form" action="addUser.php" method="post">
<label><h1> Sign up </h1></label>
</br>
<label>First Name</label>
</br>
<input onchange = "isFirstNameValid()" type ="text" id = "frstName" name="firstName" value = "" placeholder = "" >
</br>
<label>Last Name</label>
</br>
<input onchange = "isLastNameValid()" type ="text" name = "lastName" id = "lstName" value = "" placeholder = "" >
</br>
<label>Email address: </label>
</br>
<input onchange = "isEmailNameValid()" type ="text" name = "email" id = "email-input" value = "" placeholder = "" >
</br>
<label>Password</label>
</br>
<input onchange = "isPasswordOneNameValid()" type ="password" name = "password" id = "passOne" value = "" placeholder = "" >
</br>
<label>Confirm Password</label>
</br>
<input onchange = "isPasswordTwoValid()" type ="password" name = "passwordConfirm" id = "passTwo" value = "" placeholder = "" >
</br>
<p>
<span>
<label>
<input type="checkbox" checked="checked" name="Optional"> Send me email for offers and news
</label>
</span>
</br>
Already have an account? <a href="login.php">Sign in</a>
<input type ="reset" name="Reset" value = "Reset" class = "reset-button" href="create_account.php"></input>
</br>
<input onclick="login();" type ="submit" name="add" value = "Sign up" class = "submit-button";></input>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
<Script>
console.log("Injected");
function isFirstNameValid()
{
console.log("ABCD");
var usernameRegex = /^[a-zA-Z]+$/;
if(usernameRegex.test(document.getElementById("frstName").value) == true)
{
return true;
}
else
{
alert("Please enter a valid name!");
}
}
function isLastNameValid()
{
var usernameRegex = /^[a-zA-Z]+$/;
if(usernameRegex.test(document.getElementById("lstName").value) == true)
{
return true;
}
else
{
alert("Please enter a valid name!");
}
}
function isEmailValid()
{
var emailRegex = /^[a-z@.]+$/;
if(emailRegex.test(document.getElementById("email-input").value == true))
{
return true;
}
else
{
alert("Please enter a valid email address!");
}
}
function isPasswordOneValid()
{
var emailRegex = /^(?=.*[0-9])[a-zA-Z]{5,20}$/;
if(emailRegex.test(document.getElementById("passOne").value == true))
{
return true;
}
else
{
alert("Please enter a stronger password!");
}
}
function isPasswordTwoValid()
{
var emailRegex = /^(?=.*[0-9])[a-zA-Z]{5,20}$/;
if(document.getElementById("passOne").value == document.getElementById("passTwo").value)
{
return true;
}
else
{
alert("Please enter the same password!");
}
}
</Script>
<?php include "footer.html" ?>
</html>