Welcome Guest, Not a member yet? Register   Sign In
Help with adding external php lib to ci4
#1

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

Thanks,
Lony.
Reply
#2

(This post was last modified: 04-19-2020, 01:30 AM by captain-sensible.)

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
Reply




Theme © iAndrew 2016 - Forum software by © MyBB