1
deka87
captcha with catads 1.4
  • 2009/10/5 18:34

  • deka87

  • Friend of XOOPS

  • Posts: 1125

  • Since: 2007/10/5


hi, im using catads 1.4 and recently installed the security image hack by dugris to enable captcha on the submission form. came up with an issue. if you enter wrong captcha it redirects you to catads/index.php which is kind of irritating cos you loose all the entered data. i found this code in submit1.php
//Captcha
    
include_once(XOOPS_ROOT_PATH "/class/xoopsformloader.php");
    if ( 
defined('SECURITYIMAGE_INCLUDED') && !SecurityImage::CheckSecurityImage() ) {
         
redirect_header'index.php'2_SECURITYIMAGE_ERROR ) ;
         exit();
    }


how do i make it redirect back to the ads being submitted?

2
culex
Re: captcha with catads 1.4
  • 2009/10/5 21:55

  • culex

  • Module Developer

  • Posts: 711

  • Since: 2004/9/23


Well the idea is that the captcha needs to be refreshed so a page update is nessesary I guess. You can't do a double 'back in the browser' ?

or maybe replace index.php in the redirect to submit1.php ?

But in both my ideas I think the entered data will be lost.

3
deka87
Re: captcha with catads 1.4
  • 2009/10/6 5:17

  • deka87

  • Friend of XOOPS

  • Posts: 1125

  • Since: 2007/10/5


Quote:
But in both my ideas I think the entered data will be lost.


yea thats the main trouble. i've never seen a website where you can loose all the data entered by entering the wrong captcha. i'd really hate it. maybe i can do something with the registration form cos its captcha does alright

4
ghia
Re: captcha with catads 1.4
  • 2009/10/6 7:47

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


It is entirely how the functionality is implemented in the module.
Many modules (eg also Formulaire) do the following after the user has submitted the form:
- check permissions
- check captcha
- check data
- save data
If the check captcha fails, the entered data is discarded and the user is redirected to the general starting point of the module. All entered data is discarded, which is a severe punishment for the user, if the filled in form is large.

Other modules as eg Contact Us use a form object (= some data container), which contains all data of the form and then do the following:
- create an empty form object.
- show the form with the form object data.
- user fills in and do a submit.
- check permissions
- copy data entered to form object.
- check captcha
- check data
- save data
In this case there is always a form object updated with the user last edits, that is used to iniate the values for the form. If the captcha check fails the form is regenerated with the updated form object, and all answers are present again.

The data check are checks by PHP, to see if some enterences are coherent with each other and are not the Javascript checks, that are done at the user side in his browser to check if the obliged fields are not empty and generate a popup alert, that some fields input are missing. The latter have no influence on the partial filled in form, because it is not yet submitted.

An other way could be that the captcha code was sent as an hidden field as MD5 encoded. In that way the Captcha verification could also be done on the User side with Javascript with a verification function that alerts the user for a wrong captcha without submitting the form and thus also not loosing his work on the form.

This might be the simpliest and in general the most applicable method, because implementing a form object requires some turn upside down programming in the module and is rather tedious.

5
deka87
Re: captcha with catads 1.4
  • 2009/10/6 8:00

  • deka87

  • Friend of XOOPS

  • Posts: 1125

  • Since: 2007/10/5


hmm so it requires some more hacking right or is there any done solution?

6
pablo103
Re: captcha with catads 1.4
  • 2009/10/29 0:58

  • pablo103

  • Not too shy to talk

  • Posts: 181

  • Since: 2008/2/3 1


Did you solve it somehow?

7
deka87
Re: captcha with catads 1.4
  • 2009/10/29 5:59

  • deka87

  • Friend of XOOPS

  • Posts: 1125

  • Since: 2007/10/5


ended up getting rid of it. please let me know if you come up with something

Login

Who's Online

444 user(s) are online (340 user(s) are browsing Support Forums)


Members: 0


Guests: 444


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits