Jump to content

$input->post["{variable}"] empty?


Recommended Posts


I have a formular like this:

<form action="/test/" method="post">
<input type="text" name="test[1234]['value1']" />
<input type="text" name="test[1234]['value2']" />
<input type="text" name="test[1234]['value3']" />
<input type="text" name="test[2345]['value1']" />
<input type="text" name="test[2345]['value2']" />
<input type="text" name="test[2345]['value3']" />
<input type="hidden" id="_post_token" name="{$this->session->CSRF->getTokenName()}" value="{$this->session->CSRF->getTokenValue()}"/>
<input type="submit" value="Submit" name="submit" />

For testing the processing of the form looks likes this:

if($input->post->submit && $session->CSRF->validate()) {
 $data_pw = $input->post["test"];
 $data_post = $_POST["test"];
 echo "<pre>";
 echo "</pre>";

But i always get something like this...


    [1234] => Array
            ["value1"] => "Test"
            ["value2"] => "Hi"
            ["value3"] => "Hello again"
    [2345] => Array
            ["value1"] => "Oh no"
            ["value2"] => "Wait, what?"
            ["value3"] => "Bye bye"


Why is $input->post["test"] returned as an empty array?

Am i doing something wrong? (using PW 3.0.18)

Link to comment
Share on other sites

  • 11 months later...

got a similar problem :(

<form id="testform" class="col s12 InputfieldForm" name="testform" method="post" action="" data-colspacing="1">

<input placeholder="w / kW" id="power" name="power" type="text">

<input value="8,5" id="price" name="price" type="text">





after sending the form i get following output




ProcessWire\WireInputData Object

    [power] => 
    [days] => 3
    [price] => 8,5
    [power_form_sent] => 1
    [submit] => submit

tried to change action to full URL etc, did not help

any ideas ?



Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...