Welcome Guest, Not a member yet? Register   Sign In
captcha image not loading in server
#1

captcha image not loading in server
******************************
view file
********
<div id="imgdiv" style="display: inline;"><img id="img" src="<?= base_url() ?>login/getcapachaimage" /></div><img id="reload" src="<?= base_url() ?>img/reload.png" />
Reply
#2

Help us help you ... what error message or unexpected behavior are you getting?
Do your files exist? You are requesting the images "BASE_URL/login/getcapachaiumage", which sounds like a controller referencem=, and BASE_URL/img/reload.png. Is the second one showing up?
Reply
#3

Assuming you are using CodeIgniter Catpcha helper.

You have to use generated image URL instead of hardcoded URL.

Controller:
PHP Code:
$cap create_captcha($captcha_options);
$this->load->view('yourview', ['cap' => $cap]); 

View:
Code:
<?= $cap['image'] ?>

The image attribute already holds full img tag.

More in the manual:
https://www.codeigniter.com/user_guide/h...elper.html
Reply
#4

(07-13-2018, 08:10 AM)Pertti Wrote: Assuming you are using CodeIgniter Catpcha helper.

You have to use generated image URL instead of hardcoded URL.

Controller:
PHP Code:
$cap create_captcha($captcha_options);
$this->load->view('yourview', ['cap' => $cap]); 

View:
Code:
<?= $cap['image'] ?>

The image attribute already holds full img tag.

More in the manual:
https://www.codeigniter.com/user_guide/h...elper.html
I try with this solution,but not get it
I attached both file also please make a correction

Attached Files
.php   Captcha.php (Size: 1.67 KB / Downloads: 35)
.php   loginn.php (Size: 965 bytes / Downloads: 21)
Reply




Theme © iAndrew 2016 - Forum software by © MyBB