Questions tagged [php]

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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
20 views

Article slideshow

I wanted to use Bootstrap 5 carousel/sildeshow on my Joomla CMS v4. I recently updated to Joomla 4 and the previous slideshow component isnt compatible so I am left with a load of articles which ...
  • 169
1 vote
0 answers
54 views

Adding a Tag to an Article (in PHP)

In J4, when I want to set a value to a Custom Field, I use the following code and it works fine: $model = new FieldModel(array('ignore_request' => true)); $model->setFieldValue(2, $item->id, '...
2 votes
0 answers
29 views

SimpleXML load file error for cli PHP script

I am using the following code in the Joomla Cli to import news items into articles on a client's website. It was working perfectly until yesterday when an error was reported and no news items were ...
0 votes
1 answer
54 views

Display current article's specific custom field in module

Im using Joomla 4. And for some reasons I need to publish my articles with joomla 4 custom html module that shows specific custom fields of current article. I have changed mod_custom's default.php ...
  • 55
1 vote
2 answers
43 views

How do I create a new PHP variable for a blog override from the result of JDatabase join query?

In a category blog override I am attempting to reflect the featured status of an article. In order to find out whether it is currently actively featured - i.e. not 'pending' or 'expired' I am querying ...
  • 313
1 vote
1 answer
51 views

After joining two tables in phpMyAdmin how do I save the results as a dynamic table?

In order to query the exact featured status of an article in a blog override (i.e. currently featured, not pending or expired or not featured at all) I have created a query to join two tables and ...
  • 313
1 vote
1 answer
27 views

Where is Joomla's ServiceProviderInterface

I am working my way through a Joomla 4 component tutorial. I have setup Visual Studio Code's Intelephense to be able to find Joomla classes using includepath. That seems to be working fine for the ...
  • 243
1 vote
1 answer
140 views

500 Layout default not found. (Joomla 4)

I am trying to make a music component for Joomla 4 On the backend, my other forms work fine and the data is stored correctly in the database ( celebrity , album , etc...) In the music form, when I ...
1 vote
2 answers
35 views

Insert datetime type into created column from PHP file from module/component

I can't get the created column filled when inserting items into the database. I am using this code: function createRecordInLSFCDBTable($id, $userId) { echo 'createRecordInLSFCDBTable: ' . $id . ',...
1 vote
1 answer
36 views

Modifying email address through PHP

I'm using Regular Lab's sourcerer to embed code in an article to modify users' email addresses once a questionnaire has been completed (anonymization). I used this code to no avail: $user = JFactory::...
  • 21
0 votes
0 answers
55 views

Using Like with wildcard in joomla php query

Hi I am struggling to get an output from a wildcard query. I am using the following code which outputs the following error: 0 Unknown format specifier "$" $iban = '...
0 votes
0 answers
39 views

php beginner: handling array in Joomla module

Newbie in php, I am trying to create a module to extract orders from Joomla database and plot monthly results as a yearly curve. I am trying to store first the products in an array, followed by a ...
  • 31
0 votes
2 answers
35 views

New to Joomla and my site needs critical updates. HELP!

I'm new to Joomla and the site I'm taking over needs critical updates and has for some time. It needs 14 extension updates, and I'm getting this message: Your site is currently using PHP 7.2.2. This ...
0 votes
1 answer
12 views

joomla php notice error of only variable should be passed in

Hi Getting php notice error of only variable should be passed in $this->assignRef('CatList' , $modelUsedcar->loadMainCat($brand,$Carmodel)); Can anyone suggest on how to make this function ...
  • 395
1 vote
0 answers
29 views

workable php 7.4 function in joomla 3.10 is working weird in php 8.0

Am displaying list of news haviing Date News Heading Short Descrption The list is spread to around 100 pages, having 20 news in each page Issue is: This is working absolute fine in php 7.4.x in ...
  • 395
2 votes
1 answer
91 views

Show button for each iteration of foreach loop

I have built a module using Joomla's subform XML. The XML in the subform is <fieldset name="topics" label="Topic"> <field name="title" type="text&...
  • 2,066
1 vote
1 answer
28 views

PHP script to clear cache in Joomla 3.x

I created the following script and put it to cron job on server. Unfortunately it does not work. include 'includes/defines.php'; include 'includes/framework.php'; $conf = JFactory::getConfig(); $...
0 votes
0 answers
78 views

Can't you put an insert query inside of a loop?

Here's my code: $mysqli = new mysqli($dbhost, $dbUsername, $dbPassword, $dbName); // Check connection if ($mysqli->connect_error) { die("Connection failed: " . $mysqli->...
2 votes
1 answer
1k views

Joomla 3.10 admin not working after upgrade to PHP 8

My provider has upgraded the PHP version from 7.4 to 8.1. I'm working with Joomla 3.10 and thought that no actions were needed since PHP 8 is recommended for Joomla 3.10. Since the upgrade was done, I ...
0 votes
0 answers
25 views

How to push the menu information for data layer in Joomla?

I have the same forms in different menus. When a user clicks the form link, it will redirect to the form page. In google tag manager, we need to track from which menu the user has been redirected to ...
  • 1
0 votes
0 answers
17 views

Joomla Taxibooking component - show price in two currencies

I'm using component "taxibooking" by Kanev and I need a solution for displaying price in two currencies. EURO is coming to our country and my shop will have to display prices in two ...
1 vote
2 answers
45 views

Can I do a fresh joomla installation and import the old database, etc from a broken installation?

There's a broken Joomla installation in the host (not made by me) as far as I read, it's because it doesn't work with PHP7+. I'd like to make a fresh install and reuse the database that the broken ...
  • 11
0 votes
1 answer
49 views

PHP errors from ApiApplication

I get PHP errors as unhandled exceptions but I don't really see any information that can help me. How can I troubleshoot this? Unhandled exception - Joomla\CMS\Application\Exception\NotAcceptable A ...
  • 1,869
1 vote
1 answer
1k views

"Deprecated: Joomla\Input\Input ..." after upgrading PHP8.0 to PHP8.1 in Joomla 3.10.11

I have updated the PHP version from 8.0 to 8.1.0 and my Joomla version is 3.10.11. Now I am getting deprecated warning such as: Deprecated: Joomla\Input\Input implements the Serializable interface, ...
1 vote
1 answer
428 views

"Warning: session_start(): Failed to read session data" after upgrading from PHP 7.4 to PHP 8.0

After upgrading a stable Joomla 3.10.11 website from PHP 7.4 to PHP 8.0, the following error is displayed on the front end and back end of the website: Warning: session_start(): Failed to read ...
2 votes
2 answers
113 views

How to check if a file is in root subfolder

This question looks pretty easy (and probably it is), but I am stuck with the following scenario: I'm using XAMPP and have several Joomla installations in subfolders such as \joomla3, \joomla4, etc. I ...
  • 735
1 vote
1 answer
181 views

RSForm get value from html and submit as hidden field

I have a website which shows user profiles and their relevant userID is available on the page where my form is (but hidden through CSS). (The userID is for the profile being viewed and not the user ...
  • 2,066
1 vote
0 answers
47 views

How can I see a user's articles in his joomla user profile?

I hope the community can help me. In this project, I would like to use Joomla's user profile view system and display the latest user posts. I thought maybe it would be doable to create a layout in ...
  • 11
1 vote
2 answers
62 views

Use different module settings/parameters on different posts in Joomla!

TLDR: Is there an easy way to include the same instance of a module in different posts with different settings in Joomla!? What works: URL parameters. I can call the post with a URL to which I append ...
0 votes
1 answer
55 views

Session variable from a module is only accessible from the template after refresh

To add some common ground. I need to transfer 3 variables from a module to my template when the sites loading. In my module I get 3 links to specific images and they need to be included in the ...
1 vote
1 answer
52 views

Mysqli query with regex to Joomla php syntax

// CODE1 (Mysql (MariaDB 10.8.3) query): SELECT s.`p_p`, COUNT(REGEXP_SUBSTR(r.`xml`, '[0-9]+')) FROM `#__s` AS s, `#__p` AS x, `#__v` AS r WHERE REGEXP_SUBSTR(r.`xml`, '[0-9]+') = [user_id] AND s.`...
2 votes
2 answers
514 views

Joomla 4 create article programmatically

I have tried a few ways to create articles programmatically in Joomla 4, but none of my attempts are working. First is to insert data by mysql using $db->getQuery(true) -- the article shows in the ...
0 votes
1 answer
301 views

How to remove CSS and JS from Joomla 4 header?

I want to properly remove CSS and JS links from Joomla 4 header For example I did not want: <link href="/newer/media/vendor/fontawesome-free/css/fontawesome.min.css?5.15.4" rel="...
  • 83
0 votes
1 answer
78 views

How do I create parameters in a Joomla module depending on another parameter / number?

I'm trying to create a Joomla module for typical CSS cards, but I want to make the number of cards dependent on a number input from the user. For example the user wants 5 cards so in the parameter ...
0 votes
2 answers
337 views

Join tables where one column value has leading zeros and the other doesn't

I am trying to LEFT JOIN a table, but the two columns used for relating rows are not identically formatted. My problem is the value in a.vendor, it has leading zeros on it, and c.No doesn't have ...
1 vote
0 answers
120 views

Why does Joomla (or Akeeba) recommend that Output buffering is disabled?

When I use Akeeba Kickstart it recommends that output buffering is disabled. Why does it recommend this? All my research shows that it can speed up sites. It seems I'm not the only one asking https:/...
  • 1,869
0 votes
1 answer
128 views

Pulling api data and saving to mySQL

So, I am trying to pull data from EA Sports API for games like NHL or FIFA. The issues with EAs API is it only shows the last 5 games played. I am trying to have a script run every minute and save ...
  • 69
0 votes
0 answers
157 views

An exception occurred while executing 'INSERT INTO

I am trying to sign up in a portal but I am getting the following error; "SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'password' cannot be null How do I solve this problem?
1 vote
2 answers
1k views

JRequest Method in Joomla 4

JRequest Remove from Joomla 4 then how i must use this method for example $controller->execute( JRequest::getCmd('task', $view) not work i must change it to what ?
0 votes
0 answers
55 views

Joomla all versions not worked 404 pages on Litespeed server

i see front page without component, → 404 error not shows but i have its in my template.. error.php: error->getCode(); ?> - title; ?> i found very much articles, whats is maybe litespeed not support ...
4 votes
1 answer
2k views

What is the difference between mysqli and mysqlnd php extensions?

I'm considering upgrading from PHP7.4 to PHP8.0 on a Joomla 3.10.8 installation. I was surprised to find that my hosting provider only offers mysqlnd as a PHP extension in PHP 8.0, but not mysqli. ...
1 vote
1 answer
298 views

Updated to Joomla 4 and custom PHP scripts no longer run

I have just upgraded from Joomla 3.10.8 to the latest version of Joomla 4 (it is 100% better). However some of my scripts that have run for years now no longer work. The scripts basically import files ...
  • 31
0 votes
1 answer
3k views

Update Joomla! 3.10.8 to PHP 7.4 or PHP 8.0

I am using a Joomla! 3.10.8 Stack from Turnkey Linux, it shows a warning, that I have to upgrade to a higher PHP-version. So how I update/upgrade the higher PHP-version? And is it clever to upgrade to ...
  • 21
0 votes
2 answers
225 views

How can I sort an unordered list alphabetically by class with JavaScript or PHP?

In a custom J4 site I am using the Shack Locations (previously Focalpoint) core extension that displays a dynamically generated legend of location types on the front end, but it is listing the nine ...
  • 313
0 votes
0 answers
75 views

How to encrypt and decrypt User data in joomla

I am new to joomla, and working on joomla application which is currently running on production environment. Application contains 1000+ registered users. As per GDPR Policy, I have requirement for ...
  • 1
2 votes
0 answers
70 views

MySQL Server has gone away with mysqli_connect to another LAMP Stack / TURNKEY Linux

I am trying to connect to another VM (192.168.16.27) from 192.168.16.28 to get Data out of the MariaDB Database (joomla). So my Code is: $link = mysqli_connect("192.168.16.27", "user&...
  • 21
1 vote
1 answer
245 views

How to use Joomla for insert, delete, display and update data from mysql?

I'm just started to learn using Joomla and one of the things that I need to do is to build a form that can insert data and that data can be displayed to another Joomla page. I got a few comments from ...
0 votes
1 answer
83 views

Incorrect Uri::root() with external PHP file

The file /srv/http/components/com_mycomponent/ajax/editAction.php was initialized with https://github.com/joomla/joomla-cms/issues/34586#issuecomment-865080001, except that we use define('JPATH_BASE', ...
0 votes
0 answers
51 views

Problem with password reset: The object must be an array or an object that implements ArrayAccess

When I try to reset my password from my website, I get this error: Error The object must be an array or an object that implements ArrayAccess What is the root cause?
1 vote
2 answers
478 views

How can I reference JFactory within a PHP class?

In Joomla 3: I'm writing a class to represent a semi-complex data structure. In that class, some methods need to access the app, dbo, document and user objects from JFactory. Here's a snippet of the ...

1
2 3 4 5
16