• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[solved] CI 1.7.3 no data in $_POST array

Don't undestand, such simple thing but does not work.

<form action = "<?php echo base_url()?>admin_/groups/preview" target = "">
                <strong>Pavadinimas: </strong><br>
                &lt;input type="text" name="title" /&gt;&lt;br><br>
                <strong>Tekstas: </strong><br>
                &lt;textarea name = "text" cols = "90" rows = "90"&gt;&lt;/textarea><br>
                &lt;input class = "save" type="button" name="submit" value = "Išsaugoti"/&gt;
                &lt;input class = "preview" type="submit" name="preview" value = "Peržiūrėti" /&gt;

I press button withd class = "preview", it calls the right funciton, which is in action attribute, but there is no data in post array.

This does not echo anything. Can you help me?
function preview()
        echo $this->input->post('title');
        //echo stripslashes($_POST['text']);

add ';'
&lt;?php echo base_url();?&gt;

The ; is not needed. It generates fine url even when I don't use it. I found that the problem was that it used the $_GET array. I didn't add attribute method = "post". I knew there was something stuppid. I usually use echo form_open() function to create a form tag and probably it automatically adds method = "post" attribute, so thats why I forget it there Smile

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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