CodeIgniter - .htaccess file in captcha folder gets deleted -


i have codeigniter installed on wamp in root directory. problem comes in here: i've been trying out captcha's. captcha folder c:\wamp\www\captcha. problem .htaccess file inside captcha gets deleted when new captcha generated

the content of .htacces file is:

rewriteengine on  rewriterule !.*\.jpg - [f,l]  rewritecond %{script_filename} !-d rewritecond %{script_filename} !-f rewriterule (.*) - [f] 

i use return forbidden ..... message if .... .jpg file exists.

at moment have in /view file. haven't yet implemented check/submit method. feel need overcome first.

$this->load->helper('captcha'); $vals = array(     'img_path' => './captcha/',     'img_url' => 'http://localhost/captcha/',     'img_width' => '150',     'img_height' => 30,     'expiration' => 25     );  $cap = create_captcha($vals); echo $cap['image']; 

thanks in advance.

answer quite simple acctually: create folder inside captcha (in case images), , edit files accordingly:

.htaccess (in captcha folder)

rewriteengine on  rewriterule ^([0-9]+)\.([0-9]+)\.jpg$ ./images/$1\.$2.jpg [l]  rewriterule !.*\.jpg - [f,l]  rewritecond %{script_filename} !-d rewritecond %{script_filename} !-f rewriterule (.*) - [f,l] 

other "view" file

$this->load->helper('captcha'); $vals = array(     'img_path' => './captcha/images/',     'img_url' => './captcha/',     'img_width' => '150',     'img_height' => 30,     'expiration' => 3600     );  $cap = create_captcha($vals); echo $cap['image']; 

Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -