Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [jinput]

Joomla! Input Base Class This is an abstracted input class used to manage retrieving data from the application environment

0
votes
1answer
41 views

Admin Component File Upload -> Cannot Get JInput to work

I am struggling to get an admin form file upload to work using JInput. I have tried pretty much every permutation of $input->files->get(''); I can think of with no luck. No matter what I do, it ...
1
vote
1answer
34 views

Get string name with double spaces

I have one string value such as The string contains double spaces. I am fetching this string as: $string = $jinput->get('sports', '','raw'); It returns me correct result when there are no double ...
5
votes
1answer
249 views

Class 'JInput' not found after updating to 3.7.3

I am updating a clients site to 3.7.3 and following the update receive the following on both the front end and admin: Fatal error: Class 'JInput' not found in /home/wwwsitew/public_html/rmi/...
2
votes
1answer
625 views

use Joomla Subform field values in custom field from same module

I have the basic xml file where in I call subforms into two tabs. Called Tab 1 and Tab 2. The content of this file is below. mod_something.xml <fieldset name="tab1"> <field name="...
1
vote
1answer
87 views

Example form on posting data through JInput class

I've been told numerous times to use JInput Class as opposed to using 'method="post" on my forms. I have no problem finding example of how to retrieve data using JInput, but after searching numerous ...
2
votes
2answers
1k views

Add querystring parameters and generate a SEF URL

we have a custom PHP script which is running under JUMI to perform and display some data. The custom script is accessible to a SEF url such as http://www.mysite.com/jumi-script which is a ...
1
vote
2answers
454 views

Getting structured data from JInputJSON

If I send a JSON string to my controller that has a nested object in it, rather than just a simple object with a bunch of scalar properties on it, I don't seem to have a way of accessing the nested ...
2
votes
1answer
57 views

Filter an IP address

I've written the following to get the user IP: private function getIpAddress() { $server = JFactory::getApplication()->input->server; if (!empty($server->get('HTTP_CLIENT_IP'))) ...
0
votes
3answers
496 views

JRequest::get('post', JREQUEST_ALLOWRAW) has been deprecated, what is the working code now? [duplicate]

I have tried every input to get it working, but nothing works for me. This is the deprecated code $post = JRequest::get('post', JREQUEST_ALLOWRAW); list($title, $alias) = $this->...
0
votes
0answers
618 views

Model/Controller: get id of current item and use it in controller

I got a view in my component's frontend, which catches data from model using the ID of the element: protected function populateState($ordering = null, $direction = null) { $app = ...
6
votes
1answer
207 views

Equivalent of unset using jinput

How can I do the below using Joomla API JFactory::getApplication()->input; unset($_GET["variable1"]);
1
vote
1answer
411 views

Can't decode form data as json after jinput->post->getArray() if some file is chosen

I retrieve all the form data with: $jinput = JFactory::getApplication()->input; $formData = new JRegistry($jinput->post->getArray()); then decode it and convert to my custom array with: $...
4
votes
1answer
2k views

How to retrieve values of all the fields with JInput but without jform[]

As we know we can retrieve values of all the fields if they have names like name="jform[something]" and we can use the code: $jinput = JFactory::getApplication()->input; $formData = new JRegistry($...
9
votes
2answers
685 views

How to create filters for Jinput?

I have gone through with the JInput Documentation. We can access the JInput object like this: JFactory::getApplication()->input; If we are retrieving more values, it would be useful to store the ...
7
votes
2answers
3k views

How can I grab the user's IP address?

I want to store the user's IP address in a Joomla 3.5 component; with 2.5, I did a $ip = JRequest::getVar('REMOTE_ADDR', '', 'SERVER'); Which is the most efficient way to get the IP address from a ...
3
votes
1answer
2k views

Use JInput to get all POST / GET vars [duplicate]

Is there a way to get all the POST or GET vars at once using JInput? Something like this, only using the newer syntax: $post = JRequest::get('post');
0
votes
2answers
130 views

Retrieve multiple values with $jinput

How can I retrieve resource_id from the url below? index.php?option=com_ajax&module=booking_form&method=getBooking&format=json&Itemid=131&date=2016-02-04T00:00:00.000Z&end=...
1
vote
2answers
99 views

Why is Jinput only getting one of two values from the url?

I am trying to extract two values from the url with Jinput. My url is: http://localhost/kitchen-guide-new/index.php?option=com_content&view=article&id=45?subscribers_email=test@gmail.com&...
1
vote
1answer
62 views

Save JINPUT to JTable via CLI AND web-backend

I'm using a helper which is called by an Joomla-CLI-Script. In this script I would like to add items to my database using JTable::store. In the storing-process I'm checking some JINPUT-values, that ...
0
votes
2answers
109 views

jinput->get doesn't consistently return a particular URL parameter

I have a php page that processes 2 parameters on the URL that calls it. I can't figure out why jinput->get works sometimes but not every time. The code is: $jinput = JFactory::getApplication()->...
2
votes
3answers
3k views

How to properly get an array from jInput?

Maybe it's weary eyes, but I am unable to retrieve a posted array from jInput: $jinput = JFactory::getApplication()->input; $test1 = $jinput->get('Itemid'); $test2 = $jinput->get("filter"); $...
1
vote
2answers
565 views

How to set custom style in getInput function?

I thought there should be an easy way like: echo $this->form->getInput('similar_text', array('style' => 'background: red;')); But it seems to be harder than my except. I need to generate ...
2
votes
2answers
362 views

Using JInput instead of $_POST

By using var_dump($_POST);, I'm getting the following output: array(2) { ["data"] => array(2) { ["title"] => "XXX" ["server"] => "XXXXXX" } ["Itemid"] => ...
2
votes
2answers
1k views

Get the menu item variable using Jinput

I am using joomla 3.3.6 and have added a menu item type variable. I want to get the value of this variable using jinput to query the database. The controller file is external so i added the ...
1
vote
1answer
82 views

What to use instead of Jinput in Joomla 1.5?

I have the following code: defined( '_JEXEC' ) or die; class plgSystemTemplateSwitcher extends JPlugin { function onAfterInitialise() { $input = JFactory::...
3
votes
1answer
402 views

How can I use PHP to filter a list as though they had clicked on a Search Tool list item

Based on some internal conditions, I need to filter a list and have the "Search Tools" engaged showing the selected item in the filter list. The net effect that we want is the same as appending the ...
6
votes
3answers
582 views

Input filtering an array of integers, words

This is one that has bugged me for several years now - Joomla provided JRequest, and then JInput to access filtered data from the incoming request. You can ask for filtered strings, integers, words ...
6
votes
1answer
481 views

What's the difference between these 2 methods that use Jinput to get an Array?

I've been researching different ways to get an array using Jinput. According to http://docs.joomla.org/Retrieving_request_data_using_JInput there are 2 methods that I can use. I can use the ...
4
votes
1answer
665 views

Custom Component - JInput Isn't Getting the Form Input

I have an input form in the admin view: <form name="upload" method="post" enctype="multipart/form-data"> <input type="file" name="file_upload" /> <input type="submit" value="...
1
vote
1answer
152 views

Extension restrictions on Multiple File Upload (JInput)?

JLoader::register('JFile', JPATH_LIBRARIES . '/joomla/filesystem/file.php'); $fields = array('one', 'two', 'three'); foreach ($fields as $field) { $file = $input->files->get($field); $src ...
0
votes
2answers
1k views

Multiple File Upload Using JInput?

FORM HTML : <form name="upload" method="post" action="send.php" enctype="multipart/form-data"> File #1 : <input type="file" name="one" /> File #2 : <input type="file" name="two" /> ...
1
vote
2answers
318 views

JInput object does not work outside root folder? [duplicate]

i use JInput to get data from a form and insert that into the database, but it only works when the PHP file containing the JInput script is placed inside the root folder? PHP SCRIPT : <?php ...
6
votes
2answers
5k views

File upload using JInput! possible?

i use a html form on one of my articles, i am successful in getting the values from the form using JInput! $input = JFactory::getApplication()->input; But now i need to add a file upload input ...
6
votes
1answer
2k views

JInput->get() , how does it work?

I'm a beginner in Joomla and a little confused with this method. for example consider this : $app->input->get('foo',0,'int'); where is the source of foo ? JInput->get() get's inputs from ...
8
votes
3answers
4k views

What's the proper way of setting a persistent cookie in Joomla 3.x

I would like to set a "destination" cookie for all users on my site, to serve tailored content. The cookie needs to persist across login/logout so it appears I cannot use jSession, which is cleared on ...
6
votes
5answers
1k views

Where to use JInput in MVC

I'm curious as to where to get data from JInput in the MVC design pattern. For example, in a situation where I need a JInput value to use in a query in a model class method, should I get the JInput ...
26
votes
3answers
10k views

What's the proper way to get the entire $_POST?

In Joomla! 2.5.x I could simply run JRequest::get('post'); but seeing as JRequest is deprecated in Joomla! 3.x I should use JInput. At them moment this is the code I'm using to get the entire $_POST: ...