Welcome Guest, Not a member yet? Register   Sign In
an enhanced captcha as helper
#10

[eluser]Unknown[/eluser]
I followed the example above with the following code. It doesnt seem to work for me. I dont even get a print_r() !

My directory structure is as follows:

img_path = http://localhost/Paradise Calling/common/captcha/
img_url = http://localhost/Paradise Calling/common/captcha/
font_path = http://localhost/Paradise Calling/application/fonts/

Am I supposed to add place an image in one of those dirs or something?

The captcha helper is located at: http://localhost/Paradise Calling/application/helpers/

Code:
// Index page
    function index() {
        
        // Captcha section
        // Create the captcha-config
        $aCaptchaCfg = array(
            //'word'        => 'myrandomword',                            //default: random()
            'length'        => 6,                                         //default: 5
            'img_path'       => base_url().'common/captcha/',               //no default !
            'img_url'       => base_url().'common/captcha/',            // no default!
            'font_path'      => base_url().'application/fonts/',         // default: ./system/fonts/
            //'fonts'       => array('corsiva.ttf', 'TSCu_Comic.ttf'),     // default: texb.ttf
            'font_size'     => 15,                                      // default: 18
            'img_width'      => '180',                                      // default: 170
            'img_height'     => '60',                                       // default: 60
            'expiration'     => 7200                                     // default: 7200
        );
        
        // Get captcha-stuff
        $aCaptcha = create_captcha($aCaptchaCfg);
        
        print_r($aCaptcha);
        
        // Throw the captcha-array to your view and load the view
        $data['aCaptcha'] = $aCaptcha;

$this->load->view('listBlogs', $data);

My View code:

Code:
captcha-test:<br/>
    &lt;?php echo $aCaptcha['image']; ?&gt;<br/>

Ive made sure my paths are correct for img_path, img_url, font_path
Whats the problem with this?


Messages In This Thread
an enhanced captcha as helper - by El Forum - 09-27-2007, 07:39 AM
an enhanced captcha as helper - by El Forum - 09-27-2007, 01:01 PM
an enhanced captcha as helper - by El Forum - 09-30-2007, 03:13 PM
an enhanced captcha as helper - by El Forum - 10-27-2007, 10:06 AM
an enhanced captcha as helper - by El Forum - 10-27-2007, 10:29 AM
an enhanced captcha as helper - by El Forum - 10-27-2007, 08:26 PM
an enhanced captcha as helper - by El Forum - 10-29-2007, 04:27 AM
an enhanced captcha as helper - by El Forum - 10-29-2007, 04:40 AM
an enhanced captcha as helper - by El Forum - 05-08-2008, 02:21 AM
an enhanced captcha as helper - by El Forum - 05-20-2008, 02:21 AM
an enhanced captcha as helper - by El Forum - 05-20-2008, 02:54 AM
an enhanced captcha as helper - by El Forum - 05-20-2008, 05:36 AM
an enhanced captcha as helper - by El Forum - 06-04-2008, 09:52 AM
an enhanced captcha as helper - by El Forum - 09-25-2008, 10:01 PM
an enhanced captcha as helper - by El Forum - 01-11-2009, 08:35 PM



Theme © iAndrew 2016 - Forum software by © MyBB