Welcome Guest, Not a member yet? Register   Sign In
POST data missing
#1

[eluser]chubbypama[/eluser]
Hi there. I am trying to figure out why my data is not being posted. My controller cannot access it.
I'm posting a simple example here... my real code is a lot more complex. BUt this little example doesn't work either.
So I figure if I can get this working, the real code should work too.
here's the view:
Code:
<?php echo 'in here'; ?>

<div id="contact_form" class="span12">
<h2>Contact Sys Admin</h2>

  &lt;form method="post" action="http://myserver/myapp/index.php/controllerA/test"&gt;
    &lt;input type="text" id="newVlanID" value="123" /&gt;
    
    <button type="submit">Submit</button>
    &lt;/form&gt;

</div>

and in my controller :
Code:
public function test()
{
    //print_r($this->input->post(NULL, False));
           if ($this->input->post(Null, False)) {
             echo "I am here";
             $form = $this->input->post(Null, True); ## True for XSS-cleaning, which you probably want.
             exit();
           }
           else {
              echo "False";
           }
It was just prints False.
I never get the 123 value ...
Any suggestins? I know the hardcoding of the app path is bad. Just for demo purposes.
Thanks.
#2

[eluser]siptik[/eluser]
does not work because there is no attribute "name")))
false:
Code:
&lt;input type="text" id="newVlanID" value="123" /&gt;
true:
Code:
&lt;input type="text" name="newVlanID" id="newVlanID" value="123" /&gt;
Helped you?
#3

[eluser]chubbypama[/eluser]
[quote author="siptik" date="1346962131"]does not work because there is no attribute "name")))
false:
Code:
&lt;input type="text" id="newVlanID" value="123" /&gt;
true:
Code:
&lt;input type="text" name="newVlanID" id="newVlanID" value="123" /&gt;
Helped you?
[/quote]

THANK YOU!!!!!!!!!!!
#4

[eluser]siptik[/eluser]
It's my pleasure :-)




Theme © iAndrew 2016 - Forum software by © MyBB