Welcome Guest, Not a member yet? Register   Sign In
stuck with sending header('Content-type: image/jpeg') to my external view file
#1

[eluser]ladooboy[/eluser]
Hi guys,

I have a view template structre. My Base-Controller does following:

Code:
function template($data = NULL){    
        
    //    if (!$this->data) $this->data = $data;
            
    
            if (!isset($this->data['header']))  $this->data['header']  = $this->load->view('includes/header',$this->data ,TRUE);
            if (!isset($this->data['content'])) $this->data['content'] = $this->load->view($this->load_view ,$this->data,TRUE);
            if (!isset($this->data['footer']))  $this->data['footer']  = $this->load->view('includes/footer',$this->data ,TRUE);
            
                        
            $this->load->view('includes/layout', $this->data);
    }


My local controller does:

Code:
......        
        header('Content-type: image/jpeg');
        imagejpeg($image);
        imagedestroy($image);        
        
        $this->template();

The problem is, I need to send this image to my actual view, which has all the input fields and submit buttons.

Currently it creates an image on a empty page without any buttons or input fields.

Any idea how to implement this into the template view ?
#2

[eluser]vitoco[/eluser]
you can send the image as base64 encoded data
base64 for IE
| WIKI data uri scheme

Saludos
#3

[eluser]ladooboy[/eluser]
Hi !

Thanks for the info. I've already decided to use the codeigniter captcha function and this one works. Only problems are the images which are being created on fs.

I thought I could just create the image and display it without saving it to the harddisk. But looks like I have to deal with it.




Theme © iAndrew 2016 - Forum software by © MyBB