php - CodeIgniter Captcha Image name
975
CodeIgniter Captchacreate_captcha($val)
creates captcha and returns the image within theimg
tag but is it possible to get only the image name?
Example
CI Captcha returns<img src='abc.jpg'>
What I requireabc.jpg
only.
Thanks in advance.
Answer
Solution:
You can modify the imagename and set it as you want.
You can modify it directly (probably not a good idea as updates may overwrite). Or you could create your own helper by copying the original, modifying and putting it in application/helpers.
So, copy
captcha_helper.php
into application/helpers, make the changes on line 231, save, and you should be good.Answer
Solution:
according to the manual
http://www.codeigniter.com/user_guide/helpers/captcha_helper.html?highlight=captcha#create_captcha
this function allways return the img tag, the only thing i think you can do is parse it using regular expressions ...
References
http://php.net/manual/es/function.preg-match.php
http://www.phpliveregex.com/