I implement captcha in the project. I am using frameworkignign framework. In the captcha_helper.php file, the code
$use_font = ($font_path != '' AND file_exists($font_path) AND function_exists('imagettftext')) ? TRUE : FALSE;
returns false. Because it file_exists($font_path)
returns false . I am walking through
$img_path = '../../captcha/';
$img_url = base_url() . 'captcha/';
$font_path = base_url(). 'captcha/font/impact.ttf';
$captch = array(
'word' => '',
'img_path' => $img_path,
'img_url' => $img_url,
'font_path' => $font_path,
'img_width' => '200',
'img_height' => '50',
'expiration' => '300'
);
$cap = create_captcha($captch);
Now that I echo $font_path
and copy and paste the same URL in the browser, the font file will be requested as the download path. So why file_exists($font_path)
returns false . I tried my best I could not figure it out. Please help me and forgive my stupid mistakes, if any.
source
share