Welcome Guest, Not a member yet? Register   Sign In
Captcha Not Displaying
#1

[eluser]nicole.jav[/eluser]
This is my post controller

$this->load->helper('captcha');
$vals = array(

'img_path'=>'./application/captcha/',
'img_url'=>base_url().'application/captcha/',
'img_width'=>150,
'img_height'=>30
);
$cap = create_captcha($vals);
$this->session->set_userdata('captcha',$cap['word']);
$data['captcha'] = $cap['image'];
$data['cap'] = $cap['word'];
$this->load->view('post', $data)

and this is post view
echo("<br>Captcha : " . $captcha);

The image is generating fine in the folder, the source of the page when displayed in browser is showing

Captcha : <img src="http://localhost/mvc2/application/captcha/1395300779.8935.jpg" width="150" height="30" alt=" " />

but the image is not displaying . . . . . . HELP
#2

[eluser]Tpojka[/eluser]
Maybe you have problem with accessing application folder.
Try it as basic example with root folder for images.
Code:
‘img_path’=>’./captcha/’,
‘img_url’=>base_url('captcha/'),
#3

[eluser]nicole.jav[/eluser]
I have tried that too, and the same problem is with smileys, the images are just not displaying, neither the captcha, nor the smileys, if there was some error in the path, then the image should not be created, the image is generated and stored in the folder, the link is in the source, but it is not displaying Sad
#4

[eluser]nicole.jav[/eluser]
in htaccess

RewriteRule ^(.*)$ index.php/$1 [L]

this rule is restricting the images from displaying, but if I comment this rule, the site stops working, what to do with this rule
#5

[eluser]Tpojka[/eluser]
Instead that, try with this:

Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
#6

[eluser]ivantcholakov[/eluser]
It is not good the application folder to be accessible directly by the browser. It would be better the directory for captcha images to be relocated outside application/.




Theme © iAndrew 2016 - Forum software by © MyBB