This is my first stack overflow question (but not the first time I've used good answers to other questions). I am an empirical programmer on the site, so be sure, I always try until dawn starts to work on the lack of proper instructions. This is when qaru comes in handy. But this time, I’ve hit my head against the PHP wall for three or four days. Therefore, I ask for help in this matter.
Now programming is essentially pure mathematics. That is why in the end you can understand his language and what is happening. I went so far as to be a very experienced AS programmer, and then decided to switch from Flash, try my hand at HTML using JS and jQuery (so to speak, a contest) and fell in love. However, I am quite an amateur in this area. But my relationship with PHP in particular has a completely different look: I do not understand this and do not tolerate it; this is Sanskrit for me. I may not have used it enough to understand it, but it doesn't seem to be logical for me like JS and HTML, AS and ETC. to do.
Anyway, my predicament:
I created my own Shoutbox based on the excellent code given here: http://yensdesign.com/2009/01/create-a-shoutbox-using-php-and-ajax-jquery/ . However, the code does not include captcha, which makes it completely vulnerable to SPAM. Therefore, I first developed a simple captcha consisting of various images containing numbers, adding everything to a specific number. Now I'm trying to show interest, and I was trying to add Google reCaptcha .
ReCaptcha PHP. Sbox PHP, JS ; PHP , mySql, . PHP reCaptcha , , , , . , , , , : ", Captcha, -, !"
PHP JS ., , , , , : "JS , PHP - ". , . , , PHP .
, PHP , , .
, . . : .
PHP reCaptcha :
<?php
$privatekey = "your_private_key";
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if (!$resp->is_valid) {
die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
"(reCAPTCHA said: " . $resp->error . ")");
} else {
}
?>
reCaptcha, . , !
, Shoutbox , . , . , , HTML Shoutbox, JS PHP.
, RAR , Shoutbox, , . , . , . - PHP, JS , , , , , JS. PHP , , " db... bla bla" , , , Shoutbox ( ).
RAR , voilà: ( )
, !
1:
, . , .
, . , , , iframe. reCaptcha , ( , Captcha, , ). form, , , ( , JS), , . , action="shoutbox.php". , JS.
: WRONG WORDS RIGHT WORDS J. Bruni PHP reCaptcha , , , reCaptcha.
, , JS . , , . . true/false reCaptcha PHP, /, , ( , JS ), , , false. , , , , , , , , - ; ? ( .) : PHP JS 'parallel', ? ; , , , , .
, , , : " ? , ; PHP. ! , , , PHP , , PHP ! , . , , JS. , . :
, ... - , , .
, , , , shoutbox.php reCaptcha, true. false, PHP- . , Shoutbox , ; ( , reCaptcha ). , , , , , . , PHP, reCaptcha , .
reCaptcha PHP JS, . , ! . , . , -, , , .
, , . , , reCaptcha . PHP, JS, , PHP, , Sbox . , , reCaptcha, Sbox 100%, . reCaptcha Sbox. , "", JS , PHP . , , , : , , reCaptcha . , , ; , , , , . , , en reCaptcha, , . , , , , . ?
, , . , - , , .
.. , ( , PHP), reCaptcha script, , , , , , BACK, . captcha , , -, reCaptcha , ; reCaptcha , , , , . , , - . .
2
, . , "!" if PHP . .
... , , .
. if , " ". - reCapthca "", . , , if, , , , ( , ). , . if, , , , captcha , " ". - .
, , , PHP. , if/else PHP. , , if JS -, complete: function(data), , complete: function(data) . alert() if. , if , alert() , ... AJAX, , , , .
, . 100% - Sbox, , , .
3
, if complete: function(data) ; " ", , reCaptcha PHP "" .
complete: function(data){
if (data.responseText == 'wrong') {
alert('Wrong captcha');
}
messageList.html(data.responseText);
updateShoutbox();
...
P.S. ... , .
P.P.S. ReCaptcha - "". , .