Welcome Guest, Not a member yet? Register   Sign In
It is about passing array from view to controller
#1

[eluser]Frauzer[/eluser]
That is my controller page:
Code:
$this->load->helper('captcha');
      $this->load->view('captcha/createCaptcha');
      $this->load->view('iletisim',$cap);
that is my createCaptcha page:
Code:
$vals = array(
      'img_path'  => './Captcha/',
      'img_url'  => base_url('/Captcha/'),
      'expiration' => 300
      );

      $cap = create_captcha($vals);

      $data = array(
      'captcha_time' => $cap['time'],
      'ip_address' => $this->input->ip_address(),
      'word'  => $cap['word']
      );

      $query = $this->db->insert_string('captcha', $data);
      $this->db->query($query);
it does not work. It says "cap is undefined". But it is exist in createCaptcha page. Where is the problem?

Thank you...
#2

[eluser]CroNiX[/eluser]
You need to read up on how to pass dynamic data to views. Notice how they are sending the data, what format it is in and how they access it in the view.
#3

[eluser]Frauzer[/eluser]
I dont try to pass view. I try to pass controller.
#4

[eluser]Narf[/eluser]
[quote author="Frauzer" date="1330980262"]I dont try to pass view. I try to pass controller.[/quote]

That's the problem - it doesn't work that way.
#5

[eluser]Frauzer[/eluser]
What do you suggest ?
#6

[eluser]pbflash[/eluser]
disregard




Theme © iAndrew 2016 - Forum software by © MyBB