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
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

PHP is a server-side scripting language designed for web development but also used as a general-purpose programming language. Joomla is based on PHP.

0
votes
0answers
15 views

User Specific Data on User Specific Pages

OK, so I want to have clients be able to log onto my site and them be dircted to their own page. I need to show them various financial reports that come from Google Sheets, Google Slides, but only ...
0
votes
1answer
13 views

Installing two copies of the same site with same db and prefix for a test - is this ok

Before i start i know what your going to say no no no no no never install Joomla sites with the same prefix or on the same db but hear me out. Its the same website essentially one installed in route ...
1
vote
1answer
20 views

How to replace   with a space?

I am creating some code to auto-generate a meta-desc for product pages in VM. I have stripped tags, but I am still seeing &nbsp in the resulting text. The code I have at present is: if ($...
0
votes
0answers
18 views

Error: Cannot access protected property Joomla\CMS\Menu\AbstractMenu::$User

randomly tried to access the production site this morning and came across the following error immediately after logging in. I cannot navigate past it and if i hit return to control panel i am ...
0
votes
3answers
59 views

Convert PHP code to Jooma PHP syntax?

I'm running a query on phpmyadmin which has the "IN" function included. It is to extract data from the same column for different fields' (Waybill1, Waybill2 etc.) I shall post the SQL query below: ...
0
votes
0answers
33 views

How to create a Joomla MVC for consuming a RESTful API

I'm looking for some help with writing a Joomla MVC which will consume a RESTful API. The API returns data in JSON and XML. The component should have two views (a frontend list with all objects - ...
1
vote
1answer
29 views

Get module id in helper file

I need to get id of current module in helper.php file of mod_menu. But there is no module parameters in this script.
0
votes
1answer
6 views

CheckToken() error when TinyMCE init

I have a form, which add some data to DataBase. <form> <input type="text" name="mydata" /> <textarea name="mytext"></textarea> <?php echo JHtml::_( 'form.token' );?> ...
0
votes
1answer
56 views

How to access user-submitted values from a dynamic form?

I want to insert a row in my db-table with inputs from users. The form the users fill out is made with a foreach-loop: foreach ($results as $row) { echo '<div class="vm_kampe"><input ...
3
votes
1answer
24 views

How is the relationship between template styles and menus stored in Joomla 3.x?

I'm working on a tool that imports content for a new language. As part of that process, I'm creating a copy of a template style specific to the new language. After making a copy of the template style ...
2
votes
1answer
24 views

How to find path and list files in directory?

I would like to simply list some files from my web server and display the file names on the front-end of my website. I use Sourcerer plugin and created a custom module where I inserted this code to ...
1
vote
1answer
32 views

Make div disapear after a while

I have made a page, where if the user update its form, the backend will send the user back to the form with a message like this: header('loaction:/index.php?msg'); On the index.php site, it loads ...
0
votes
0answers
14 views

Select file stored on web server and send as attachment in email?

I was hoping someone could help me/guide me in the right direction with this issue. I want to create a button called "Send File". When this button is clicked, a directory on my web server is opened ...
0
votes
0answers
38 views

How to redirect a different url using Controller page

After submitting a form, the page refresh with a thank you message. So how can I redirect that page to a different url after successfully submitting the form. Current Form codes are as following: &...
1
vote
1answer
38 views

How can I use a username and password to login with PHP?

I have a custom page that checks if cUser->id is zero and, if it is, I pop up a login form. Now I can't seem to find any documentation on how to remotely log in to Joomla. Any ideas?
0
votes
0answers
24 views

How to fetch data from database in a function of helper.php file of joomla module

I am new to joomla. I have developed a simple module. I need to fetch data from database in a function of helper.php. I am using $db = JFactory::getDbo(); But it giving fatal error Uncaught Error:...
-1
votes
1answer
59 views

JOIN multiple queries?

I was wondering if anyone could help me JOIN multiple queries into one query. Currently, these 2 blocks of code retrieve information from the DB. I am using "Sourcerer" plugin to add custom PHP code ...
4
votes
3answers
58 views

Add where statement to database query

I need to modify the database query to not select a certain ID in the database so the items with that ID do not show in the results. However, I cannot figure out how to do this. below I added a WHERE ...
1
vote
1answer
67 views

Convert line breaks in php textarea

I have a kind of a guestbook on my page. It's just a common textarea like this: echo ' <textarea name="msg"></textarea>'; and then I use a form to send me to the backend on submit: $db =...
0
votes
1answer
28 views

Convert article to PDF?

I was wondering if anyone knows of any way to take the HTML content of a custom module which is placed inside an article and convert the HTML to PDF via the click of a button or so. So basically the ...
0
votes
2answers
23 views

How to re-write sql for joomla JDatabase

I am new to custom Joomla coding so excuse me for this, I want to execute the following statement: "SELECT MAX(CASE WHEN v.FieldName = 'Team_Name' THEN v.FieldValue END) 'Team_Name' , MAX(...
1
vote
1answer
28 views

Send mail on execute

I have a page, where people can sign up with name and mail to a waitinglist. When they write the info, the backend add it to my db and I have an admin-page to show the list. But I would like to ...
0
votes
1answer
27 views

Hikashop, extract text after read more

I want to have the introtext and then the rest of the text in Hikashop product details page. So in the product description I insert the <hr id="system-readmore" /> to separate the introtext and ...
0
votes
1answer
26 views

Use one pdo connection across multiple modules?

I have multiple modules on the same page that are individually connecting to the same external database through pdo connections. The website is getting slower since I added more modules. My guess is ...
2
votes
1answer
27 views

Component Development PHP Version Check

I've been developing a component, and have been trying to find some information, to no avail, of having my component perform a check of the PHP version before install. If PHP is greater than 7, then ...
3
votes
2answers
92 views

Check if INSERT query was successful or failed because of a duplicate UNIQUE KEY

I have a db-table called league where the mail column is the unique id: |name |mail | |Bryan|bryan@hotmail.com | I have a frontend where users can sign up and then I have this for ...
0
votes
2answers
64 views

Rows with same id in same div

I have a db-table called vm_kupon. It looks a little like this: |id |uid |bet | |1 |20 |1 | |2 |20 |2 | |1 |21 |X | |2 |21 |1 | |1 |22 |X | |2 |22 |X | I ...
0
votes
1answer
40 views

Don't add empty fields to database after submission?

Is there any PHP code which will allow me to NOT submit any empty fields to the database. I have a form with about 200 fields, and a lot of the times many of them are empty. How can I not add the ...
2
votes
1answer
38 views

Joomla Migrating Live Site To Localhost -Navigation Not Working

I just migrated a Joomla site from live to localhost. Have the front end up and can access the backend without problem. Front end wise none of the menu items work. I have renamed the live site ...
2
votes
1answer
72 views

What is the prefered method for sharing code and SQL queries in joomla 3.9+?

I'm developing a component that is targeting Joomla 3.9+. The code is not using the legacy classes and is instead using the new namespaces. The component will duplicate much of the functionality from ...
0
votes
1answer
17 views

How can I prevent Joomla from removing octothorpe/pound from URL post login?

For example, I would like to send the following links in an email to users: https://www.example.com/#foo https://www.example.com/deep-link/#foo When clicked on, I get the following results: https://...
0
votes
1answer
40 views

implode - URL doubling - image display error

Trying to display the avatar(image) from a folder already stored using a form. Error: image not displayed. I found the URL doubled in the inspect element: ----------inspect element-------------------...
0
votes
1answer
55 views

Php-sql result in joomla displayed in question marks

I have a simple sql query, in a joomla php server, rs forms pro. The result contains Greek characters. However, the result is displayed in question marks. $sql = "SELECT `FieldValue` FROM `table` ...
1
vote
0answers
77 views

joomla make a ajax request for another php file

Excuse me for my English. I'm a newbie in joomla. I make a phone book component and i wanna add a Ajax pagination. I've got Jquery function load_data where i put a url to my php page. And this is ...
1
vote
1answer
36 views

PHP: Check if a module is displayed on the current page

I'm having some issues with checking if a module is displayed on the current page. I tried out different approaches with JModuleHelper methods, eg isEnabled, but it only works with module types not ...
2
votes
1answer
84 views

Access PHP Session from Joomla backend

I have a php session value like this, $_SESSION['variable'] = "value"; How to access this session value in Joomla admin? This session value is stored in PHP file and not in Joomla front end (php ...
1
vote
0answers
57 views

How to upload an image using Ajax?

I need to upload an image to the server via AJAX, but the server comes back to the page with request, although server doesn't send anything. ajax: function uploadServer($el) { var fileUpload = $...
0
votes
1answer
89 views

Update specific row in FOREACH loop

I've tried and tried, but I can't get this to work. I use Joomla and I have 2 articles/pages, one for edit and one for posting the form. I have a database with all the matches for the World Cup coming ...
0
votes
1answer
38 views

Uploading files using jfile and saving to database - project with RSticket

In RSTicket, you have the option to add or edit a ticket. But it does not allow you to add personalized files (images or pdf), i.e. files such as invoices, receipts, photos, etc. I have created this ...
0
votes
1answer
257 views

How to convert JSON string to array? [closed]

I need to get the values of a custom field list type with sql. I extract the fieldparams value using SELECT fieldparams,id FROM #__fields where context='com_content.article' and state=1 And i get ...
0
votes
1answer
119 views

How can I save multiple dynamic values using check boxes?

I have a form which fetches and displays data from two databases (sessions, students) and allows a curriculum manager to select different combinations of students and classes by clicking check boxes. ...
0
votes
1answer
28 views

Downloading large data sets

My site has a facility to download a potentially large body of data from my database as a CSV file. This is currently implemented using a view.csv.php file that serves this data by first setting the ...
0
votes
1answer
44 views

Why my code doesn't work?

I am using the following code: $db = JFactory::getDBO(); $query = $db->getQuery(true); $query->select('name') ->from ('#__gruposlocales'); $query-> where('latitudX = ' . (int) $lat); $...
2
votes
1answer
103 views

How can I translate SQL code into something that Joomla will take?

I am in the same case discussed on https://stackoverflow.com/questions/11709043/mysql-update-column-with-value-from-another-table, that is, I need to copy the value of a column from tableA to tableB ...
0
votes
0answers
22 views

echo sorting direction without grid.sort on selected column

using JHTML grid.sort I can sort the columns but I want to sort without this <?php echo JHTML::_( 'grid.sort', JText::_('lastName'), 'lastName', $this->sortDirection, $this->sortColumn); ?&...
0
votes
0answers
7 views

Disable user from adding to cart based on certain condition

I basically need to disable a user from adding a product to the cart, IF another product with a different "customfield_value" than the one already in the cart, tries to be added by the user. Let's ...
1
vote
1answer
144 views

Display data based on multiple where clause?

I would appreciate some help with the following. I have two customfields with ID "6" and "7". I want to display the customfield_value for customfield(6), only when a specific condition for ...
3
votes
1answer
52 views

Accessing ajax/REST based php api

Someone built a site using joomla and third party plugin RS Forms Pro and created a page where a client could configure and purchase a product (via stripe). But they have asked me to write some ...
0
votes
0answers
48 views

Form submission on joomla module backend

Created a module and added a form on backend with submit button using custom form field as below public function getInput() { return '<form action="http://localhost/joomla/payment" method="...
2
votes
1answer
40 views

How to override a module js file

Is possible override a js file of a module in template? The path of js file is modules/my_module/js/file.js Thank so much!