Questions tagged [jinput]

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

Filter by
Sorted by
Tagged with
1 vote
2 answers
114 views

Identify Joomla 4 API access

If I do an API call like this: curl --location --request GET "http://127.0.0.1:8000/api/index.php/v1/users" --header "X-Joomla-Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" I get ...
maidan's user avatar
  • 383
1 vote
0 answers
132 views

Getting input param from controller in Joomla 3 vs. 4

When doing this in a frontend controller: class MyControllerCustom extends BaseController { public function __construct($config = array()) { parent::__construct($config); ...
Mike's user avatar
  • 341
3 votes
1 answer
272 views

Is the following everything one should do to prevent SQL injection?

In order to sanitize the user input in an article insertion form (title and HTML content), here are the bits that I've included: Use of JInput: $jinput = JFactory::getApplication()->input; get ...
Vincenzo Oliva's user avatar
0 votes
1 answer
151 views

Upload single or multiple files replacing deprecated JRequest::getVar('file', '', 'files', 'array');

I am trying to upload a single or array of files and am not sure how to use the jinput with the array and filter. Tried multiple suggestions from here and documentation and cannot make it work for me. ...
Scott Smith's user avatar
0 votes
1 answer
221 views

get value of hidden field via Jinput

hello i created a form in front via a plugin in my tmpl i create a file value_form.php (compatible with the component) <form id="contact-form-'.$formid.'" method="POST" class=&...
user2822359's user avatar
0 votes
2 answers
159 views

Get template params from the input

Previously I was looking into how to get the template I'm currently editing, now I need to make use of a templates/templateName/helper.php file which would need a different kind of request. // this ...
thednp's user avatar
  • 405
0 votes
1 answer
92 views

How to conditionally add filters to my query of the rsform_submission_values table?

$FormId=23; $qustioan1=qka1; <form method="post" action="#"> <select name="state" onChange="irancitylist(this.value);"> <option ...
saeed's user avatar
  • 43
0 votes
1 answer
486 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['...
user1616338's user avatar
3 votes
1 answer
2k 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....
Eoin's user avatar
  • 1,889
1 vote
2 answers
609 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 ...
Daniel Jensen's user avatar
0 votes
1 answer
174 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 ...
Zachary Draper's user avatar
1 vote
1 answer
45 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 ...
Liz.'s user avatar
  • 1,375
5 votes
1 answer
353 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/...
Dtorr1981's user avatar
  • 532
2 votes
1 answer
1k 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 ...
purple11111's user avatar
1 vote
1 answer
125 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 ...
tim92109's user avatar
2 votes
2 answers
3k 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 ...
neting.it's user avatar
1 vote
2 answers
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 ...
John Rix's user avatar
  • 547
2 votes
1 answer
116 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'))) ...
Lodder's user avatar
  • 26.8k
1 vote
3 answers
1k 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->...
810's user avatar
  • 13
0 votes
0 answers
1k 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 = ...
MyFault's user avatar
  • 677
5 votes
1 answer
309 views

Equivalent of unset using jinput

How can I do the below using Joomla API JFactory::getApplication()->input; unset($_GET["variable1"]);
Malaiselvan's user avatar
  • 2,701
1 vote
1 answer
638 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: $...
stckvrw's user avatar
  • 891
4 votes
1 answer
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($...
stckvrw's user avatar
  • 891
10 votes
2 answers
871 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 ...
Joomler's user avatar
  • 1,791
6 votes
2 answers
5k 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 ...
Tom Kuschel's user avatar
4 votes
1 answer
5k 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');
user101289's user avatar
  • 1,119
0 votes
2 answers
173 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=...
Robin Mukanganise's user avatar
1 vote
2 answers
126 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&[email protected]&...
Omri's user avatar
  • 25
1 vote
1 answer
94 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 ...
MyFault's user avatar
  • 677
0 votes
2 answers
174 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()->...
JimW's user avatar
  • 1
2 votes
3 answers
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"); $...
GDP's user avatar
  • 7,705
1 vote
2 answers
720 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 ...
Mohammad Naji's user avatar
2 votes
2 answers
446 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"] => ...
Lodder's user avatar
  • 26.8k
2 votes
2 answers
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 ...
Jai's user avatar
  • 21
1 vote
1 answer
105 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::...
Dimm's user avatar
  • 13
3 votes
1 answer
479 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 ...
GDP's user avatar
  • 7,705
6 votes
3 answers
820 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 ...
John Rix's user avatar
  • 547
7 votes
1 answer
584 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 = ...
TryHarder's user avatar
  • 2,340
4 votes
1 answer
807 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="...
Eric's user avatar
  • 245
1 vote
1 answer
177 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 ...
saibbyweb's user avatar
  • 2,279
0 votes
2 answers
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" /> ...
saibbyweb's user avatar
  • 2,279
1 vote
2 answers
361 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 ...
saibbyweb's user avatar
  • 2,279
6 votes
2 answers
7k 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 ...
saibbyweb's user avatar
  • 2,279
6 votes
1 answer
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 ...
Saman Mohamadi's user avatar
8 votes
3 answers
5k 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 ...
user2097091's user avatar
6 votes
5 answers
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 ...
doovers's user avatar
  • 499
26 votes
2 answers
14k 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: ...
Spunkie's user avatar
  • 897