Questions tagged [jinput]
Joomla! Input Base Class This is an abstracted input class used to manage retrieving data from the application environment
40
questions
26
votes
3answers
12k 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:
...
10
votes
2answers
820 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 ...
9
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 ...
7
votes
1answer
534 views
How to access an array in $_GET using JInput?
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.
Method1
$jinput = ...
7
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 ...
6
votes
2answers
6k 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
3answers
716 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
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 ...
6
votes
2answers
4k 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 ...
5
votes
1answer
272 views
Equivalent of unset using jinput
How can I do the below using Joomla API JFactory::getApplication()->input;
unset($_GET["variable1"]);
5
votes
1answer
322 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/...
4
votes
1answer
3k 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($...
4
votes
1answer
738 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="...
3
votes
1answer
315 views
How to use HTMLHelper to add to the document head
In this post: How to add CSS/JS/an Image to a module backend @lodder shows me how to use HTMLHelper to add CSS and JavaScript.
Previously I had followed the Joomla! documentation https://docs.joomla....
3
votes
1answer
4k 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');
3
votes
1answer
432 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 ...
2
votes
2answers
443 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
3answers
4k 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");
$...
2
votes
1answer
82 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')))
...
2
votes
1answer
81 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 ...
2
votes
1answer
915 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 ...
2
votes
2answers
2k 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 ...
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
2answers
692 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 ...
1
vote
1answer
548 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:
$...
1
vote
2answers
122 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
96 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::...
1
vote
2answers
343 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
...
1
vote
1answer
43 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 ...
1
vote
2answers
1k 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 ...
1
vote
3answers
751 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->...
1
vote
1answer
165 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 ...
1
vote
2answers
338 views
UPDATE query to add 1 to multiple columns
I have a website for my football team. I have some statistics and so on in there, for example how many games each player has played and so on.
What I would like, is for me to write in the names of ...
1
vote
1answer
104 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 ...
0
votes
2answers
2k 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" />
...
0
votes
2answers
150 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=...
0
votes
1answer
106 views
Setting Joomla input
I'm using
$jinput = JFactory::getApplication()->input;
to get an array of the input from a page.
I then use:
$foo = $jinput->get('jform', '', 'raw');
I can then
echo $foo['...
0
votes
2answers
122 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()->...
0
votes
1answer
95 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 ...
0
votes
0answers
895 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 = ...