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
24 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 ...
  • 153
1 vote
0 answers
56 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); ...
  • 341
3 votes
1 answer
150 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 ...
0 votes
1 answer
91 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. ...
0 votes
1 answer
95 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=&...
0 votes
2 answers
102 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 ...
  • 395
0 votes
1 answer
58 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 ...
  • 43
0 votes
1 answer
326 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['...
3 votes
1 answer
1k 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....
  • 1,839
1 vote
2 answers
512 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 ...
0 votes
1 answer
154 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
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 ...
  • 1,365
5 votes
1 answer
343 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/...
  • 542
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 ...
1 vote
1 answer
114 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
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 ...
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 ...
  • 527
2 votes
1 answer
106 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'))) ...
  • 26.5k
1 vote
3 answers
960 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->...
  • 13
0 votes
0 answers
999 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 = ...
  • 667
5 votes
1 answer
292 views

Equivalent of unset using jinput

How can I do the below using Joomla API JFactory::getApplication()->input; unset($_GET["variable1"]);
  • 2,651
1 vote
1 answer
615 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: $...
  • 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($...
  • 891
10 votes
2 answers
858 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 ...
  • 1,781
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 ...
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');
  • 1,089
0 votes
2 answers
160 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
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&id=45?subscribers_email=test@gmail.com&...
  • 25
1 vote
1 answer
92 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 ...
  • 667
0 votes
2 answers
156 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()->...
  • 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"); $...
  • 7,685
1 vote
2 answers
718 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
2 answers
444 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"] => ...
  • 26.5k
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 ...
  • 21
1 vote
1 answer
100 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::...
  • 13
3 votes
1 answer
460 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 ...
  • 7,685
6 votes
3 answers
784 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 ...
  • 527
7 votes
1 answer
564 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 = ...
  • 2,330
4 votes
1 answer
792 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="...
  • 245
1 vote
1 answer
176 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 ...
  • 2,269
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" /> ...
  • 2,269
1 vote
2 answers
356 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 ...
  • 2,269
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 ...
  • 2,269
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 ...
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 ...
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 ...
  • 499
26 votes
2 answers
13k 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: ...
  • 887