• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
php includes

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:


so i uploaded the file it needs to require into the SYSTEM folder of codeigniter...

when i run:


i get the following errors:

A PHP Error was encountered

Severity: Warning

Message: require_once() [function.require-once]: URL file-access is disabled in the server configuration

Filename: user_control/register.php

Line Number: 21


A PHP Error was encountered

Severity: Warning

Message: require_once(http://donov.co.uk/game/system/recaptchalib.php) [function.require-once]: failed to open stream: no suitable wrapper could be found

Filename: user_control/register.php

Line Number: 21


Fatal error: require_once() [function.require]: Failed opening required 'http://donov.co.uk/game/system/recaptchalib.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/donov/public_html/game/application/views/user_control/register.php on line 21

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)

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.

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

edit: oh and yes you should use the application folder to add any thing to your web-application

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.

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.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.