Welcome Guest, Not a member yet? Register   Sign In
[solved] CI 1.7.3 no data in $_POST array
#1

[eluser]SPeed_FANat1c[/eluser]
Don't undestand, such simple thing but does not work.

Code:
<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;
            &lt;/form&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?
Code:
function preview()
    {
        
        echo $this->input->post('title');
        //echo stripslashes($_POST['text']);
    }
#2

[eluser]toopay[/eluser]
add ';'
Code:
&lt;?php echo base_url();?&gt;
#3

[eluser]SPeed_FANat1c[/eluser]
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




Theme © iAndrew 2016 - Forum software by © MyBB