-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcaptcha.html
More file actions
267 lines (237 loc) · 7.97 KB
/
captcha.html
File metadata and controls
267 lines (237 loc) · 7.97 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
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<style type="text/css">
body{
background-color: #a2a2a2;
}
form.registration{
width:290px;
margin: 10px auto;
padding:10px;
font-family: "Trebuchet MS";
}
form.registration fieldset{
background-color:#707070;
text-align:center;
border:none;
padding:10px;
-moz-box-shadow: 0 1px 3px rgba(0,0,0,0.5);
-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.5);
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
padding:6px;
margin:0px 30px 0px 0px;
}
form.registration legend{
text-align:center;
color:#fff;
font-size:14px;
padding:0px 4px 25px 4px;
margin-left:20px;
font-weight:bold;
}
form.registration label{
font-size: 18px;
width:200px;
text-align: center;
clear:left;
margin:4px 4px 0px 0px;
padding:0px;
color: #FFF;
text-shadow: 0 1px 1px rgba(0,0,0,0.8);
}
form.registration input{
font-family: "Trebuchet MS";
font-size: 18px;
float:center;
width:290px;
border:1px solid #cccccc;
color:#067090;
height:25px;
-moz-box-shadow: 0 1px 3px rgba(0,0,0,0.5);
-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.5);
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
}
form.registration input:focus, form.registration select:focus{
background-color:#fff;
}
form.registration select{
font-family: "Trebuchet MS";
font-size: 20px;
float:center;
border:1px solid #cccccc;
margin:2px 0px 2px 2px;
color:#00abdf;
height:32px;
-moz-box-shadow: 0 1px 3px rgba(0,0,0,0.5);
-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.5);
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
}
.button, .button:visited{
float:center;
background: #2daebf url(images/overlay.png) repeat-x;
font-weight:bold;
display: inline-block;
padding: 5px 10px 6px;
color: #fff;
text-decoration: none;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-moz-box-shadow: 0 1px 3px rgba(0,0,0,0.5);
-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.5);
text-shadow: 0 -1px 1px rgba(0,0,0,0.25);
border-bottom: 1px solid rgba(0,0,0,0.25);
cursor: pointer;
margin-top:95px;
margin-right:15px;
}
.button:hover{
background-color: #007d9a;
}
.captcha_wrap{
border:1px solid #fff;
-moz-border-radius:10px;
-webkit-border-radius:10px;
-moz-box-shadow: 0 1px 3px rgba(0,0,0,0.5);
-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.5);
float:left;
height:120px;
overflow:auto;
width:150px;
overflow:hidden;
margin:0px 0px 0px 210px;
background-color:#fff;
}
.captcha{
-moz-border-radius:10px;
-webkit-border-radius:10px;
font-size:12px;
color:#BBBBBB;
text-align: center;
border-bottom:1px solid #CCC;
background-color:#fff;
}
input[type="range"]{
-webkit-appearance: none;
background-image: url("images/slider2.png");
background-repeat:no-repeat;
background-size: 100%;
float:left;
}
input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
background-image: url("images/slider_button_inactive.png");
background-repeat: no-repeat;
width: 35px;
height: 30px;
}
</style>
</head>
<body>
<form class="registration" name="myform" method="post">
<fieldset>
<legend>About you</legend>
<label>First name</label>
<input type="text" maxlength="100" value="" name="fname"/>
<label>Last name</label>
<input type="text" maxlength="100" value="" name="lname"/>
</fieldset>
<fieldset>
<label>Phone number</label>
<input type="text" maxlength="100" value="" name="phonename"/>
<legend>Contact info</legend>
<label>E-Mail</label>
<input type="text" maxlength="120" value="" name="emailname"/>
</fieldset>
<legend style="margin-left:44px; padding:5px;">Drag slider until images changes</legend>
<fieldset>
<table>
<tr>
<td colspan="2">
<img id="happy" valign="bottom" align="left" height="60" width="60" src="images/Sad_face.png"/>
</td>
<td>
<label>Move slider to change the face to </label>
<label id="face"></label>
</td>
<td>
</td>
</tr>
</table>
<br>
<input id="in" type="range" min="0" max="10000" value="0" step="1" onchange="showValue(this.value)" />
<input id="send" type="button" value="Submit" name="send"onclick="boolChecker()"/>
</fieldset>
<fieldset>
<legend>Created by ECPI Students</legend>
<img id="logo" src="images/emoticaptcha_logo.png"/>
</fieldset>
<script type="text/javascript">
document.getElementById('in').value = 0;
var random=Math.floor((Math.random()*8000)+1000);
var round=Math.floor(random/1000);
var checker=false;
var face=new Array("Sad","Smiley","Pirate","Green","Skeleton","Lovey","Nerd","Purple","Devil");
var loop=0;
document.getElementById("face").innerHTML=face[round];
function showValue(slider)
{
while(slider/1000>=loop){
document.getElementById("happy").src = "images/"+face[loop-1]+"_face.png";
if(slider<1000||slider==10000)
document.getElementById("happy").src = "images/Sad_face.png";
loop++
}
loop=0;
if(Math.floor(slider/1000)==round+1){
checker=true;}
else{
checker=false;}
}
function boolChecker(){
if (checker == true){
alert("Successful selection");
sendEmail();
}
else if (checker == false){
alert("Incorrect selection");
}
}
</script>
<script type="text/javascript">
function sendEmail() {
var email = document.forms["myform"]["emailname"].value;
var fullname = document.forms["myform"]["fname"].value+document.forms["myform"]["lname"].value;
$.ajax({
type: "POST",
url: "https://mandrillapp.com/api/1.0/messages/send.json",
data: {
"key": "6oUW6tWjRMxpdSw8QQITHA",
"message": {
"from_email": "employmentguide@de.com",
"to": [
{
"email": email,
"name": fullname,
"type": "to"
}
],
"autotext": "true",
"subject": "Confirmation email from EmploymentGuide.com",
"html": "Your contact information was submitted sucessfully. We also hope you enjoyed the new captcha!"
}
}
}).done(function(response) {
console.log(response); // if you're into that sorta thing
});
}
</script>
</fieldset>
</form>
</body>
</html>