php includes |
[eluser]Unknown[/eluser]
Ok so im trying to install reCaptcha onto one of my sites... for those who dont know, reCaptcha is a simple anti bot / anti spam application... To install it it needs to use: require_once(); so i uploaded the file it needs to require into the SYSTEM folder of codeigniter... when i run: require_once(base_url().'system/recaptchalib.php'); i get the following errors: Code: A PHP Error was encountered now i vaguley understand that its because codeignightor doesnt let you use require_once(); and that there should be a way to remove this restriction in the config.php... i cant find the option to remove the restriction... maybe theres a better way... can anyone help? (this is the first time i used CVM im probably doing it wrong)
[eluser]Dyllon[/eluser]
CI does not restrict access to any php functions. You should add libraries to your application directory, not your system directory. I haven't used reCaptcha personally nor do I know what the file structure looks like but in most cases it's a matter of dropping the desired library into the libraries folder, adding the include path, and possibly writing a small wrapper.
[eluser]must[/eluser]
hi, Personally i wasn't aware of this restriction because i never had to use require_once() or include() in Codeigniter. You can implement Recaptcha as a helper or a plugin check plugins / helpers or you can simply use one of the libraries offered by the community http://codeigniter.com/wiki/ReCAPTCHA/ http://codeigniter.com/wiki/reCAPTCHA_2/ edit: oh and yes you should use the application folder to add any thing to your web-application
[eluser]Unknown[/eluser]
I setup the ReCAPTCHA_2 helper and it displays fine... The validation fails every time tho... i have a feeling that its because the field you type the answer into isnt the field that the validation checks... however i dont see another field to check. If i post back the field its trying to validate i get nothing.
[eluser]must[/eluser]
Make sure that you're checking the recaptcha_challenge_field field (and check the html source to be sure that that's the field you need to be checking on). if you can't get it to work try http://codeigniter.com/wiki/ReCAPTCHA/ it's more organized and compatible plus it has a good documentation and examples that you can follow. |
Welcome Guest, Not a member yet? Register Sign In |