• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creating captcha in form

#1
[eluser]Musaddiq Khan[/eluser]
I want to include CI captcha in form.

I have used the following code.
Code:
$this->load->helper('captcha');
vals = array(
    'img_path'  => '<img src="http://phphost/furniture/static/captch/button.jpg" alt="" />' ,
    'img_url'  => 'http://phphost/furniture/static/captcha/'
    );

$cap = create_captcha($vals);
echo $cap['image'].'Hello....';

But it display nothing.

#2
[eluser]vrencianz[/eluser]
<b>img_path</b> must be 'furniture/static/captcha/' and make sure that that directory exists and it is writeable by codeigniter.

#3
[eluser]Musaddiq Khan[/eluser]
I have tried as described above, but no result
even nothing is in $cap array.

#4
[eluser]InsiteFX[/eluser]
Code:
$this->load->helper('captcha');
vals = array(
    'img_path'  => './furniture/static/captch/',
    'img_url'  => 'http://phphost/furniture/static/captcha/'
    );

$cap = create_captcha($vals);
echo $cap['image'].'Hello....';

#5
[eluser]Musaddiq Khan[/eluser]
I can't understand that what's wrong with my code, Still $cap is null.
But thanks to all.

#6
[eluser]InsiteFX[/eluser]
Even I missed this at first look! But I am AWAKE now!
Code:
$this->load->helper('captcha');

// whats wrong with the line below? Missing $
vals = array(

// should be:
$vals = array(
    'img_path' => './furniture/static/captch/',
    'img_url'  => 'http://phphost/furniture/static/captcha/'
    );

$cap = create_captcha($vals);
echo $cap['image'].'Hello....';



Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.