Forums

captcha in external file error

mattiadj 16 Jan, 2012
Hello to all,
as always i manage my code in external files.

After the file upload and other things now my problem is how to embed correctly the {chronocaptcha_img} in my external php file.

If i put it in CF custom code all is ok but if this code is in external file, no captcha loaded and only the string is written.

How can i include correctly captcha (and also reCaptcha) in my php external files?

Thanks
GreyHead 16 Jan, 2012
Hi mattiadj ,

There are two choices I know of:

(a) copy the code that ChronoForms uses and included that in your external file; I think that if you use {chronocaptcha_img} as a place holder for the image that will work OK.

(b) Put all the code, except the Captcha and the Submit button in an external file and include that from a Custom element.

Bob
mattiadj 16 Jan, 2012
Hi Grey.

Not really understand the (a) solution.
I think the (b) is more clear but i have to try it...All you tell is to include in external file all form code excpet captcha and sumbit and insert it at the end of custom code after the include() function which include the php file?

Hi mattiadj ,

There are two choices I know of:

(a) copy the code that ChronoForms uses and included that in your external file; I think that if you use {chronocaptcha_img} as a place holder for the image that will work OK.

(b) Put all the code, except the Captcha and the Submit button in an external file and include that from a Custom element.

Bob

GreyHead 16 Jan, 2012
Hi mattiajd,

Not quite. Use a Custom element in the Preview view to include your code.

Bob
mattiadj 14 Sep, 2013
Hello Bob
i answer now to this topic but now i really need a solution.
I have CF 4.0 and i have a very complex form with a file and folder structure of php files.
I can't add a piece of code after the include element in form code but i need to ONLY use external files.
Also i need to add ReCaptcha. If i put ReCaptcha code in code form on CF all is ok...if i put it in external files it is not loaded but, as said, i need to use only external files and ReCapatcha.

Please help🙂

Thanks!
GreyHead 14 Sep, 2013
Hi mattiadj,

You can still use included files with the ChronoForms Preview box; I'm not really sure what the problem is. I think that if you add {ReCaptcha} in the Form HTML that is enough - but you still need the Load ReCaptcha and Check ReCaptcha actions in the On Load and On Submit events. If you can't use those then you'd need to hand-code the ReCaptcha.

Bob
This topic is locked and no more replies can be posted.