Welcome Guest, Not a member yet? Register   Sign In
NO image showing ?
#1

[eluser]Unknown[/eluser]
hello.

my captcha image are not showing ?
AND
my smiley images are not showing ?


Im following a tutorial and no images seem to show.


if i right click on an image i get the correct url to the image but no image.


if i change my $config['base_url'] to the full image path and inspect the image i can see the image but it is still not showing on the page:

Code:
$config['base_url'] = 'file:///Users/rickyspires/Sites/TRAINING/cms_frameworks/codeigniter/';

also that breaks the rest of the site Smile

please could someone help.

i am running on a local mamp pro enviroment

This is the url i see when i inspect the captcha

Code:
<p>
Captcha Code:
<img width="150" height="30" alt=" "  src="http://ci-blog.com/captcha/1386669555.79.jpg">
</p>

my domain (set up in mamp pro) is ci-blog.com

the file is at the above location.


------------------------------------------------------------------------------


THIS IS MY CAPTCHA CODE
but to be honest i dont think the problem is in the code anymore.


my post controller looks like this:

Code:
//CAPTCHA
$this->load->helper('captcha');
$vals=array(
'img_path'=>'./captcha/',
'img_url'=>base_url().'captcha/',
'img_width'=>150,
'img_height'=>30
);    
$cap = create_captcha($vals);  
$this->session->set_userdata('captcha',$cap['word']);
$data['captcha']=$cap['image'];




my comments controller looks like this:

Code:
//test captcha
if(strtolower($this->session->userdata('captcha')) !=strtolower($_POST['captcha'])){
echo"<p>The captcha code was incorrect! You typed in ".$_POST['captcha']." and the code was ".$this->session->userdata('captcha')."</p>";
}else{
$this->load->model('comment');
$data=array(
'post_id'=>$post_id,
'user_id'=>$this->session->userdata('user_id'),
'comment'=>$_POST['comment']
);
$this->comment->add_comment($data);
redirect(base_url().'posts/post/'.$post_id);
}


my view looks like this:


Code:
<p>Captcha Code: &lt;?= $captcha ?&gt;</p>
<br />
&lt;?php
$data_form=array(
'name'=>'captcha'  //this is an input box
);
echo form_input($data_form);
?&gt;



base url =
Code:
base_url $config['base_url'] = ";



i have an do_upload function in an uploads controller using gd2
Code:
$config['image_library'] =  'gd2'; //or imagemagick



any ideas

thanks
ricky




Theme © iAndrew 2016 - Forum software by © MyBB