|
You last visited: Today at 21:34
Advertisement
CAPTCHA after a estimated time or button clicks.
Discussion on CAPTCHA after a estimated time or button clicks. within the Web Development forum part of the Coders Den category.
04/18/2016, 20:15
|
#1
|
elite*gold: 46
Join Date: Jun 2013
Posts: 506
Received Thanks: 38
|
CAPTCHA after a estimated time or button clicks.
Hello,
I have a question regarding to adding a captcha (preferably the one from Google) to a my site.
How can I require a captcha after a estimated time spent on the site that pops up when you first open the site and for example after 60 secounds again. You have to complete the captcha to be able to use the site.
OR
How can I set up a captcha that users have to complete after a couple of html button clicks? For example: when the user clicked the button 2 times he has to complete another captcha before he is able to cklick the button again?
Have a great and safe day,
Marcel
|
|
|
04/19/2016, 10:15
|
#2
|
dotCom
elite*gold: 12400
Join Date: Mar 2009
Posts: 15,875
Received Thanks: 4,381
|
You can log every action in a database table from the user when he click the buttons and submits the form.
By every submit it will check if the user has submitted two or three times the form and after a count you want he need to input a captcha.
|
|
|
04/19/2016, 13:51
|
#3
|
elite*gold: 46
Join Date: Jun 2013
Posts: 506
Received Thanks: 38
|
Quote:
Originally Posted by Devsome
You can log every action in a database table from the user when he click the buttons and submits the form.
By every submit it will check if the user has submitted two or three times the form and after a count you want he need to input a captcha.
|
Sounds good. How can I acomplish that? Im relatively new to html and php..
|
|
|
04/20/2016, 21:18
|
#4
|
elite*gold: 46
Join Date: Jun 2013
Posts: 506
Received Thanks: 38
|
PUSH
|
|
|
04/24/2016, 21:37
|
#5
|
elite*gold: 46
Join Date: Jun 2013
Posts: 506
Received Thanks: 38
|
PUSH
|
|
|
04/27/2016, 17:23
|
#6
|
elite*gold: 0
Join Date: Jul 2007
Posts: 196
Received Thanks: 83
|
What you want (from what I can tell), is this javascript code:
Code:
function injectCaptcha(element, sitekey) {
return function() {
// injecting the google javascript
var script = document.createElement('script');
script.setAttribute('src', 'https://www.google.com/recaptcha/api.js');
document.querySelector('head').appendChild(script);
// triggering the google api
element.setAttribute('class', 'g-recaptcha');
element.setAttribute('data-sitekey', sitekey);
}
}
var element_to_hold_captcha = document.getElementById('my_empty_captcha_div');
var mysitekey = '6Lf8lgUISZZZZZZZAsdTBkiymY';
var cooldown = 100; // ms
setTimeout(injectCaptcha(element_to_hold_captcha, mysitekey), cooldown);
|
|
|
04/28/2016, 00:32
|
#7
|
elite*gold: 46
Join Date: Jun 2013
Posts: 506
Received Thanks: 38
|
Quote:
Originally Posted by BurnerGR
What you want (from what I can tell), is this javascript code:
Code:
function injectCaptcha(element, sitekey) {
return function() {
// injecting the google javascript
var script = document.createElement('script');
script.setAttribute('src', 'https://www.google.com/recaptcha/api.js');
document.querySelector('head').appendChild(script);
// triggering the google api
element.setAttribute('class', 'g-recaptcha');
element.setAttribute('data-sitekey', sitekey);
}
}
var element_to_hold_captcha = document.getElementById('my_empty_captcha_div');
var mysitekey = '6Lf8lgUISZZZZZZZAsdTBkiymY';
var cooldown = 100; // ms
setTimeout(injectCaptcha(element_to_hold_captcha, mysitekey), cooldown);
|
When I add this to my site nothing happens..
How/Where do I have to implement the code?
|
|
|
04/28/2016, 00:36
|
#8
|
elite*gold: 55
Join Date: Oct 2009
Posts: 5,471
Received Thanks: 1,479
|
Quote:
Originally Posted by BurnerGR
What you want (from what I can tell), is this javascript code:
Code:
function injectCaptcha(element, sitekey) {
return function() {
// injecting the google javascript
var script = document.createElement('script');
script.setAttribute('src', 'https://www.google.com/recaptcha/api.js');
document.querySelector('head').appendChild(script);
// triggering the google api
element.setAttribute('class', 'g-recaptcha');
element.setAttribute('data-sitekey', sitekey);
}
}
var element_to_hold_captcha = document.getElementById('my_empty_captcha_div');
var mysitekey = '6Lf8lgUISZZZZZZZAsdTBkiymY';
var cooldown = 100; // ms
setTimeout(injectCaptcha(element_to_hold_captcha, mysitekey), cooldown);
|
This is not nearly secure and can easily be stripped out on the client side.
This has to be done on the server side. Each request to the server has to check the timedifference to the last captcha and whether it is overdue. In case it is, display the captcha and drop every other request until it has been solved.
|
|
|
04/28/2016, 01:33
|
#9
|
elite*gold: 46
Join Date: Jun 2013
Posts: 506
Received Thanks: 38
|
Quote:
Originally Posted by Frosttall
This is not nearly secure and can easily be stripped out on the client side.
This has to be done on the server side. Each request to the server has to check the timedifference to the last captcha and whether it is overdue. In case it is, display the captcha and drop every other request until it has been solved.
|
That sounds very good and understandable.
BUT the problem is that I cant do that myself without a tutorial or help of someone. Scince im a newcomer in this, its pretty hard to do that and if I would try, I would probably do anything but not the thing I want in the end.
You sound like you know what you talking about, would you mind helping me out a bit? We can chat over skype or something to make that whole thing a bit easier. I think you are german becouse of your signature. Im am too, so communitaction wouldnt be a big problem.
|
|
|
04/28/2016, 12:39
|
#10
|
elite*gold: 0
Join Date: Jul 2007
Posts: 196
Received Thanks: 83
|
Quote:
Originally Posted by Frosttall
This is not nearly secure and can easily be stripped out on the client side.
This has to be done on the server side. Each request to the server has to check the timedifference to the last captcha and whether it is overdue. In case it is, display the captcha and drop every other request until it has been solved.
|
I never said that nothing must be done on the server side, it's just he seemed to have handled the back-end code...
Simply keep tracking of users, add timers and eventually spit the final javascript. After N amount of time for a certain session you could force the captcha validation, both back-end and front-end.
That javascript code is just one crucial part of the mechanism he wants.
If he has not enough experience I can do it, but not for free.
|
|
|
04/29/2016, 00:27
|
#11
|
elite*gold: 46
Join Date: Jun 2013
Posts: 506
Received Thanks: 38
|
Quote:
Originally Posted by BurnerGR
I never said that nothing must be done on the server side, it's just he seemed to have handled the back-end code...
Simply keep tracking of users, add timers and eventually spit the final javascript. After N amount of time for a certain session you could force the captcha validation, both back-end and front-end.
That javascript code is just one crucial part of the mechanism he wants.
If he has not enough experience I can do it, but not for free.
|
How much do you want?
|
|
|
05/07/2016, 13:59
|
#12
|
elite*gold: 46
Join Date: Jun 2013
Posts: 506
Received Thanks: 38
|
push
|
|
|
Similar Threads
|
Script clicks all the time
08/24/2014 - AutoIt - 5 Replies
Hello!
I used to use autohotkey, but since it is not possible to use on the server I play, i have found autoit. It is completely new for me. After few days of reading I have created my own script where
1)pixel should be read at given coordinates
2)if pixel is not there F4 should be sent
Script should be working over and over. Unfortunately for me -
script is not doing anything.
If i use "Not @error" then it is pressing f4 all the time even I'm 100% sure pixel is there.
To explain...
|
any estimated time for the server check?
03/21/2012 - S4 League - 2 Replies
~title~ i looked everywhere! nothing.
|
All times are GMT +2. The time now is 21:34.
|
|