Search code examples
joomlajoomla2.5jinput

Get Dynamic Post Fields/Data via JInput in Joomla


Basically as the question describes, I need to get "POST" data in Joomla 2.5/3.xx and I want it through the JInput (the new talk of the town).

Now everything is fine and dandy, until my further requirements needs those fields/data to be dynamic, ie. It(the fields) is designed to change depending on circumstances,there's no way for me to know what the fields are gonna be, I know how to do it in core php, but that's not the case with JInput, so thats it, how do I do it...


Solution

  • Well I know this has been some time since this was asked, but I came across the issue today and found a Joomla solution for POST forms.

    $input = JFactory::getApplication()->input;
    $fieldname = $input->post->get('fieldname');
    

    This is essentially the same as using $fieldname = $_POST['fieldname']; except you get the added benefit of staying within Joomla's API.