Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c738245
commit 5bb2441
Showing
78 changed files
with
18,098 additions
and
18,098 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
$(function(){ | ||
$("#refreshimg").click(function(){ | ||
$.post('newsession.php'); | ||
$("#captchaimage").load('image_req.php'); | ||
return false; | ||
}); | ||
|
||
$("#captchaform").validate({ | ||
rules: { | ||
captcha: { | ||
required: true, | ||
remote: "process.php" | ||
} | ||
}, | ||
messages: { | ||
captcha: "Correct captcha is required. Click the captcha to generate a new one" | ||
}, | ||
submitHandler: function() { | ||
alert("Correct captcha!"); | ||
}, | ||
success: function(label) { | ||
label.addClass("valid").text("Valid captcha!") | ||
}, | ||
onkeyup: false | ||
}); | ||
|
||
}); | ||
$(function(){ | ||
$("#refreshimg").click(function(){ | ||
$.post('newsession.php'); | ||
$("#captchaimage").load('image_req.php'); | ||
return false; | ||
}); | ||
|
||
$("#captchaform").validate({ | ||
rules: { | ||
captcha: { | ||
required: true, | ||
remote: "process.php" | ||
} | ||
}, | ||
messages: { | ||
captcha: "Correct captcha is required. Click the captcha to generate a new one" | ||
}, | ||
submitHandler: function() { | ||
alert("Correct captcha!"); | ||
}, | ||
success: function(label) { | ||
label.addClass("valid").text("Valid captcha!") | ||
}, | ||
onkeyup: false | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
|
||
// Echo the image - timestamp appended to prevent caching | ||
echo '<a href="index.php" onclick="refreshimg(); return false;" title="Click to refresh image"><img src="images/image.jpg?' . time() . '" width="132" height="46" alt="Captcha image" /></a>'; | ||
|
||
<?php | ||
|
||
// Echo the image - timestamp appended to prevent caching | ||
echo '<a href="index.php" onclick="refreshimg(); return false;" title="Click to refresh image"><img src="images/image.jpg?' . time() . '" width="132" height="46" alt="Captcha image" /></a>'; | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,66 @@ | ||
<?php | ||
|
||
// Make the page validate | ||
ini_set('session.use_trans_sid', '0'); | ||
|
||
// Include the random string file | ||
require 'rand.php'; | ||
|
||
// Begin the session | ||
session_start(); | ||
|
||
// Set the session contents | ||
$_SESSION['captcha_id'] = $str; | ||
|
||
?> | ||
<!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="en" lang="en"> | ||
|
||
<head> | ||
<title>AJAX CAPTCHA</title> | ||
<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> | ||
<meta name="keywords" content="AJAX,JHR,PHP,CAPTCHA,download,PHP CAPTCHA,AJAX CAPTCHA,AJAX PHP CAPTCHA,download AJAX CAPTCHA,download AJAX PHP CAPTCHA" /> | ||
<meta name="description" content="An AJAX CAPTCHA script, written in PHP" /> | ||
|
||
<script type="text/javascript" src="../../lib/jquery.js"></script> | ||
<script type="text/javascript" src="../../jquery.validate.js"></script> | ||
<script type="text/javascript" src="captcha.js"></script> | ||
|
||
<link rel="stylesheet" type="text/css" href="style.css" /> | ||
<style type="text/css"> | ||
img { border: 1px solid #eee; } | ||
p#statusgreen { font-size: 1.2em; background-color: #fff; color: #0a0; } | ||
p#statusred { font-size: 1.2em; background-color: #fff; color: #a00; } | ||
fieldset label { display: block; } | ||
fieldset div#captchaimage { float: left; margin-right: 15px; } | ||
fieldset input#captcha { width: 25%; border: 1px solid #ddd; padding: 2px; } | ||
fieldset input#submit { display: block; margin: 2% 0% 0% 0%; } | ||
#captcha.success { | ||
border: 1px solid #49c24f; | ||
background: #bcffbf; | ||
} | ||
#captcha.error { | ||
border: 1px solid #c24949; | ||
background: #ffbcbc; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
|
||
<h1><acronym title="Asynchronous JavaScript And XML">AJAX</acronym> <acronym title="Completely Automated Public Turing test to tell Computers and Humans Apart">CAPTCHA</acronym>, based on <a href="http://psyrens.com/captcha/">http://psyrens.com/captcha/</a></h1> | ||
|
||
<form id="captchaform" action=""> | ||
<fieldset> | ||
<div id="captchaimage"><a href="<?php echo $_SERVER['PHP_SELF']; ?>" id="refreshimg" title="Click to refresh image"><img src="images/image.php?<?php echo time(); ?>" width="132" height="46" alt="Captcha image" /></a></div> | ||
<label for="captcha">Enter the characters as seen on the image above (case insensitive):</label> | ||
<input type="text" maxlength="6" name="captcha" id="captcha" /> | ||
<input type="submit" name="submit" id="submit" value="Check" /> | ||
</fieldset> | ||
</form> | ||
|
||
<p>If you can't decipher the text on the image, click it to dynamically generate a new one.</p> | ||
|
||
</body> | ||
|
||
<?php | ||
|
||
// Make the page validate | ||
ini_set('session.use_trans_sid', '0'); | ||
|
||
// Include the random string file | ||
require 'rand.php'; | ||
|
||
// Begin the session | ||
session_start(); | ||
|
||
// Set the session contents | ||
$_SESSION['captcha_id'] = $str; | ||
|
||
?> | ||
<!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="en" lang="en"> | ||
|
||
<head> | ||
<title>AJAX CAPTCHA</title> | ||
<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> | ||
<meta name="keywords" content="AJAX,JHR,PHP,CAPTCHA,download,PHP CAPTCHA,AJAX CAPTCHA,AJAX PHP CAPTCHA,download AJAX CAPTCHA,download AJAX PHP CAPTCHA" /> | ||
<meta name="description" content="An AJAX CAPTCHA script, written in PHP" /> | ||
|
||
<script type="text/javascript" src="../../lib/jquery.js"></script> | ||
<script type="text/javascript" src="../../jquery.validate.js"></script> | ||
<script type="text/javascript" src="captcha.js"></script> | ||
|
||
<link rel="stylesheet" type="text/css" href="style.css" /> | ||
<style type="text/css"> | ||
img { border: 1px solid #eee; } | ||
p#statusgreen { font-size: 1.2em; background-color: #fff; color: #0a0; } | ||
p#statusred { font-size: 1.2em; background-color: #fff; color: #a00; } | ||
fieldset label { display: block; } | ||
fieldset div#captchaimage { float: left; margin-right: 15px; } | ||
fieldset input#captcha { width: 25%; border: 1px solid #ddd; padding: 2px; } | ||
fieldset input#submit { display: block; margin: 2% 0% 0% 0%; } | ||
#captcha.success { | ||
border: 1px solid #49c24f; | ||
background: #bcffbf; | ||
} | ||
#captcha.error { | ||
border: 1px solid #c24949; | ||
background: #ffbcbc; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
|
||
<h1><acronym title="Asynchronous JavaScript And XML">AJAX</acronym> <acronym title="Completely Automated Public Turing test to tell Computers and Humans Apart">CAPTCHA</acronym>, based on <a href="http://psyrens.com/captcha/">http://psyrens.com/captcha/</a></h1> | ||
|
||
<form id="captchaform" action=""> | ||
<fieldset> | ||
<div id="captchaimage"><a href="<?php echo $_SERVER['PHP_SELF']; ?>" id="refreshimg" title="Click to refresh image"><img src="images/image.php?<?php echo time(); ?>" width="132" height="46" alt="Captcha image" /></a></div> | ||
<label for="captcha">Enter the characters as seen on the image above (case insensitive):</label> | ||
<input type="text" maxlength="6" name="captcha" id="captcha" /> | ||
<input type="submit" name="submit" id="submit" value="Check" /> | ||
</fieldset> | ||
</form> | ||
|
||
<p>If you can't decipher the text on the image, click it to dynamically generate a new one.</p> | ||
|
||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
<?php | ||
|
||
// Include the random string file | ||
require 'rand.php'; | ||
|
||
// Begin a new session | ||
session_start(); | ||
|
||
// Set the session contents | ||
$_SESSION['captcha_id'] = $str; | ||
|
||
<?php | ||
|
||
// Include the random string file | ||
require 'rand.php'; | ||
|
||
// Begin a new session | ||
session_start(); | ||
|
||
// Set the session contents | ||
$_SESSION['captcha_id'] = $str; | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
<?php | ||
|
||
// Begin the session | ||
session_start(); | ||
|
||
// To avoid case conflicts, make the input uppercase and check against the session value | ||
// If it's correct, echo '1' as a string | ||
if(strtoupper($_GET['captcha']) == $_SESSION['captcha_id']) | ||
echo 'true'; | ||
// Else echo '0' as a string | ||
else | ||
echo 'false'; | ||
|
||
<?php | ||
|
||
// Begin the session | ||
session_start(); | ||
|
||
// To avoid case conflicts, make the input uppercase and check against the session value | ||
// If it's correct, echo '1' as a string | ||
if(strtoupper($_GET['captcha']) == $_SESSION['captcha_id']) | ||
echo 'true'; | ||
// Else echo '0' as a string | ||
else | ||
echo 'false'; | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<?php | ||
|
||
// Create a random string, leaving out 'o' to avoid confusion with '0' | ||
$char = strtoupper(substr(str_shuffle('abcdefghjkmnpqrstuvwxyz'), 0, 4)); | ||
|
||
// Concatenate the random string onto the random numbers | ||
// The font 'Anorexia' doesn't have a character for '8', so the numbers will only go up to 7 | ||
// '0' is left out to avoid confusion with 'O' | ||
$str = rand(1, 7) . rand(1, 7) . $char; | ||
|
||
<?php | ||
|
||
// Create a random string, leaving out 'o' to avoid confusion with '0' | ||
$char = strtoupper(substr(str_shuffle('abcdefghjkmnpqrstuvwxyz'), 0, 4)); | ||
|
||
// Concatenate the random string onto the random numbers | ||
// The font 'Anorexia' doesn't have a character for '8', so the numbers will only go up to 7 | ||
// '0' is left out to avoid confusion with 'O' | ||
$str = rand(1, 7) . rand(1, 7) . $char; | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,46 @@ | ||
/********************************** | ||
Name: cmxform Styles | ||
***********************************/ | ||
form.cmxform { | ||
width: 370px; | ||
font-size: 1.0em; | ||
color: #333; | ||
} | ||
|
||
form.cmxform legend { | ||
padding-left: 0; | ||
} | ||
|
||
form.cmxform legend, form.cmxform label { | ||
color: #333; | ||
} | ||
|
||
form.cmxform fieldset { | ||
border: none; | ||
border-top: 1px solid #C9DCA6; | ||
background: url(../images/cmxform-fieldset.gif) left bottom repeat-x; | ||
background-color: #F8FDEF; | ||
} | ||
|
||
form.cmxform fieldset fieldset { | ||
background: none; | ||
} | ||
|
||
form.cmxform fieldset p, form.cmxform fieldset fieldset { | ||
padding: 5px 10px 7px; | ||
background: url(../images/cmxform-divider.gif) left bottom repeat-x; | ||
} | ||
|
||
/********************************** | ||
Name: cmxform Styles | ||
***********************************/ | ||
form.cmxform { | ||
width: 370px; | ||
font-size: 1.0em; | ||
color: #333; | ||
} | ||
|
||
form.cmxform legend { | ||
padding-left: 0; | ||
} | ||
|
||
form.cmxform legend, form.cmxform label { | ||
color: #333; | ||
} | ||
|
||
form.cmxform fieldset { | ||
border: none; | ||
border-top: 1px solid #C9DCA6; | ||
background: url(../images/cmxform-fieldset.gif) left bottom repeat-x; | ||
background-color: #F8FDEF; | ||
} | ||
|
||
form.cmxform fieldset fieldset { | ||
background: none; | ||
} | ||
|
||
form.cmxform fieldset p, form.cmxform fieldset fieldset { | ||
padding: 5px 10px 7px; | ||
background: url(../images/cmxform-divider.gif) left bottom repeat-x; | ||
} | ||
|
||
form.cmxform label.error, label.error { | ||
/* remove the next line when you have trouble in IE6 with labels in list */ | ||
color: red; | ||
font-style: italic | ||
/* remove the next line when you have trouble in IE6 with labels in list */ | ||
color: red; | ||
font-style: italic | ||
} | ||
div.error { display: none; } | ||
input { border: 1px solid black; } | ||
input { border: 1px solid black; } | ||
input.checkbox { border: none } | ||
input:focus { border: 1px dotted black; } | ||
input.error { border: 1px dotted red; } | ||
input.error { border: 1px dotted red; } | ||
form.cmxform .gray * { color: gray; } |
Oops, something went wrong.