• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with adding external php lib to ci4

Hey there,

I have a problem to load php library in CodeIgniter 4
I actually use this captcha library: https://www.phpcaptcha.org/

And now my problem is, i don't know how to process to load my library,
i have the first php file(securimage.php) to check the captcha code like this:
PHP Code:
if (!$securimage->check($captcha)) {
            return $isGood false;

and the second (securimage_show.php) to show the captcha and other file for the running of captcha like this:
PHP Code:
<img src="captcha" alt="CAPTCHA Image"/><br>
a href="#" onclick="document.getElementById('captcha').src = 'captcha?' + Math.random(); return false">[ Different Image ]</a

Now to make it work i need to assign the object (Securimage provide by the securimage.php file) to a variable
PHP Code:
$captcha= new Securimage(); 

I hope i write my problem as clean as possible Smile


i have had a quick look , i think one problem is that if you look inside secureimage.php it is not conforming to use of namespace.

i've done my own simple captacha , if you click go to website below my post then add url /blackcat

you will see a very simple generation of numbers. I can help with that otherwise maybe a new thread captach options, ease of use etc

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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