Welcome Guest, Not a member yet? Register   Sign In
Show all posted data
#1

[eluser]Lobosaurus[/eluser]
Hello,

how can I display all data in $_POST using $this->input->post(). My form is a part of quiz system where names attributes are question id´s and values are answer id´s and I don´t know exactly which will be randomly selected to use $this->input->post('variable').
#2

[eluser]Référencement Google[/eluser]
No sure this will work, and not really understood what's your need but you can try to put in your form as name an array name="value[]"

Then in your controller loop on $_POST['value']

Maybe could you put some code here?
#3

[eluser]Lobosaurus[/eluser]
I would like to use CI´s Input class syntax to show all posted data and make some actions and then loop it.

I use for example this code to remove the last value in $_POST array (usually a submit button):

Code:
$last = array_pop($_POST);
print_r($_POST);

I suppose that $_POST array and $this->input->post() are sanitized in different ways and may differ in the future.
#4

[eluser]charlieD[/eluser]
I guess you could try this:

Code:
echo '<ul>';
foreach ($_POST as $key=>$value)
{
    $cleanVal = $this->input->post($key);
    echo "<li>$key = $cleanVal</li>";
}
echo '</ul>';




Theme © iAndrew 2016 - Forum software by © MyBB