Welcome Guest, Not a member yet? Register   Sign In
[solved]Call to undefined function db_clean()
#21

[eluser]maria clara[/eluser]
it still shows the same error but when i refresh the page the forms were filled up but the icon field where the file name of the image should take place is NULL. does my view have an effect on what's happening in my code???
here's my view for file upload:
Code:
<?php echo form_open_multipart('at_reports/post');?>
                                    <input type="file" name="file_name" class="tb" title="<?=lang('icon');?>"/>
                                    <input type="submit" value="upload" />
                                    </form>
#22

[eluser]maria clara[/eluser]
@ JHackamack,

thanks for your helping me figuring the db_clean and xss_clean functions..

regards,
kahtrinaWink
#23

[eluser]JHackamack[/eluser]
[quote author="maria clara" date="1264162656"]it still shows the same error but when i refresh the page the forms were filled up but the icon field where the file name of the image should take place is NULL. does my view have an effect on what's happening in my code???
here's my view for file upload:
Code:
<?php echo form_open_multipart('at_reports/post');?>
                                    <input type="file" name="file_name" class="tb" title="<?=lang('icon');?>"/>
                                    <input type="submit" value="upload" />
                                    </form>
[/quote]

When you refreshed it probably kept the $_POST values and filled in your view. The File field can't be repopulated as it relates to a file on your computer. If, after submit, your Database entry for icon is still null I'd double check your uploader and make sure it isn't dead
#24

[eluser]maria clara[/eluser]
hi,

i had an updated code, and when i refreshed my page it shows in the icon field a zero value. i attached a picture for you to see what i mean.

thanks,
maria
#25

[eluser]maria clara[/eluser]
hi,

i had an updated code, and when i refreshed my page it shows in the icon field a zero value. i attached a picture for you to see what i mean.

thanks,
maria
#26

[eluser]JHackamack[/eluser]
Does your icon vile ever get uploaded. Also, what is your icon value set as in your database?
#27

[eluser]maria clara[/eluser]
it don't upload. here's my icon values:
Quote:field: icon
type: varchar
length: 100
default: NULL
collation: utf8_general_ci
null: yes

here's my code also
Code:
$fields = array(
                    
                    
                    "module_name"=>$this->input->post('module_name'),
                    "slug"=>$this->input->post('slug'),
                    "icon"=>$this->input->post('file_name'),        
                    "report_file_name"=>$this->input->post('report_file_name'),
                    "sql_select"=>$this->input->post('sql_select'),
                    "sql_filter"=>$this->input->post('sql_filter'),
                    "sql_order"=>$this->input->post('sql_order')
                
                );
                
                
                if ($_FILES){
                    $config['upload_path'] = './reports/module/';
                    $config['allowed_types'] = 'gif|jpg|png';
                    $config['max_size']    = '100';
                    $config['max_width']  = '1024';
                    $config['max_height']  = '768';
                    $config['remove_spaces'] = true;
                    $config['overwrite'] = false;
                    
                    $this->load->library('upload', $config);    
                    if (strlen($_FILES['userfile']['file_name'])){
                        if(!$this->upload->do_upload('userfile')){
                            $this->upload->display_errors();
                            exit();
                        }
                        $image = $this->upload->data();
                        /*if ($image['file_name']){
                            $fields['image'] = "reports/module/".$image['file_name'];
                        }*/
                    }
                    
                    //$this->upload->initialize($config);
                    
                    
                }
                $item = $this->input->post("item");
                $rows = $this->input->post("row0");
                            
                                            
                $data['item'] = $this->Reports->save($fields,$item,$rows);    
                                            
                                            
                $c .= 'Successfully saved item';
        
                }

                $data['response'] = $c;
                $json['json'] = $data;
#28

[eluser]JHackamack[/eluser]
try this:
Code:
if ($_FILES){
print_r($_FILES);
die();

what do you see?
#29

[eluser]maria clara[/eluser]
i see the same image i attached a while ago. and my console shows this:
Quote:{"action":"view","db":{"item":"59","module_name":"listing","slug":"listing","icon":"0","report_file_name":"listing","sql_select":"listing","sql_filter":"listing","sql_order":"listing"},"count":{"detFlex1":"0"},"response":"Array"}

icon field is zero.
#30

[eluser]JHackamack[/eluser]
$_FILES should look something like
Code:
[file1] => Array
        (
            [name] => MyFile.txt (comes from the browser, so treat as tainted)
            [type] => text/plain  (not sure where it gets this from - assume the browser, so treat as tainted)
            [tmp_name] => /tmp/php/php1h4j1o (could be anywhere on your system, depending on your config settings, but the user has no control, so this isn't tainted)
            [error] => UPLOAD_ERR_OK  (= 0)
            [size] => 123   (the size in bytes)
        )

    [file2] => Array
        (
            [name] => MyFile.jpg
            [type] => image/jpeg
            [tmp_name] => /tmp/php/php6hst32
            [error] => UPLOAD_ERR_OK
            [size] => 98174
        )




Theme © iAndrew 2016 - Forum software by © MyBB