• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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, 09: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: 2)
.php   loginn.php (Size: 965 bytes / Downloads: 1)
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


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