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

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.

3
votes
1answer
41 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
172 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
93 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 ...
1
vote
1answer
48 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
46 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 ...
3
votes
1answer
85 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
33 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
62 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
104 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
166 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
58 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
204 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
108 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
147 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
61 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
547 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
258 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
39 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
45 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
119 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
52 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
13 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
303 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
84 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
58 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
65 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!
0
votes
1answer
564 views

creating users programmatically causing conflict with logged in username display

Okay, so we are currently using joomla's user class to create new staff, In our staff page. It works well and successfully creates the new user account. But we have an issue, because the user account ...
1
vote
1answer
387 views

How to place Joomla Shortcode in Template File

Seems the only way to get a shortcode to function in Joomla is via placing it in an article, unlike 'do_shortcode' in WordPress. So, if my shortcode is for example, {msg userid=123}, how would I get ...
1
vote
1answer
66 views

Checking if category has an published article

I have this piece of code in my template <?php if ($showLeftColumn) : ?> <aside class="sppb-col-md-3 custom-style-left"> <jdoc:include type="modules" name="left-top" style="...
2
votes
1answer
18 views

What type of extension processes non-HTML markup in an article?

I'd like to develop an extension that processes images and related data using article markup, such as is done by Articles Anywhere, for example: {article 999}{/article} In my case it would look ...
-1
votes
2answers
125 views

Programmatically switch to another 'Tab' in SW Tabs for K2

My clients site uses K2 and SW Tabs Pro. The client wants a button at the bottom of the content of the first tab that switches to the tab titled 'Pošalji upit'. For example, on this page this is #...
1
vote
1answer
54 views

My JUri::getInstance() Doesn't match my $item->link

I am having a weird problem. I am trying to do a check if the requested url is the same as the $item->link. I know they aren't the same, so I am trying to by exploding the two. I have the following ...
1
vote
1answer
244 views

Database query to select a specific year

I am trying to convert a small php script to a component for Joomla, So far it is working well. But I would like to make some adjustments. The view shows data in a table of numbers from specific ...
0
votes
1answer
387 views

Fabrik Cross database joins

I have two separate databases with the same credentials: in db1.table1 there is a column containing filepaths that I need to update with a filename that is stored in db2.table2 and that I can retrieve ...
0
votes
1answer
177 views

BreezingForms unique user email validation problem

I've created a form using BreezingForms(free). Before submitting the form I'm checking if the entered email address is unique using the "Before submit" field in my form settings. The code I am using ...
2
votes
1answer
316 views

Joomla registration emails and PHP mail() taking hours to deliver

UPDATE UPDATE UPDATE: Okay so all the emails ended up arriving, but they took anywhere from 30 minutes to 9 hours. Here's the raw message of one maybe osmeone can decipher it for me. Delivered-To: my....
2
votes
1answer
112 views

How to Completely Remake (Delete, Then Add) Menu Items Through Joomla Framework

A couple of previous questions have touched on this topic (how to add menu items, how to hide menu items), but I'm trying to figure out how to remove or empty a menu and then programmatically refill ...
2
votes
2answers
59 views

Errors with PHP code — please advise a complete beginner

I'm managing a Joomla website that uses DJ Classifieds as the main component; the 'ads' are actually resumes, and employers buy a subscription to access an ad's details. In the past, users who didn't ...
0
votes
2answers
239 views

Why does strpos function in first condition always return true?

Something is wrong with my code. No matter what the $_SERVER['REQUEST_URI'] value is, gkPageContent is always displayed. if (strpos($_SERVER['REQUEST_URI'], "online") >= 0) { $left_col_class =...
1
vote
1answer
101 views

Joomla Subform output

OK, I have tried the info from another suggestion on stackexchange, but I seem to be missing something. I have a subform in an admin view for a component I am working on (they were previously ...
3
votes
2answers
504 views

how to set tmp path and log pat

I am trying to set tem directory path and logs dir path in my joomla site . my site folder path is this "/httpdocs/example.com/online" and my site url this http://dev.maindomain.com/example/online/. ...
1
vote
1answer
226 views

How to debug a 500 can't load error?

I have moved a website running joomla from my old VPS to my own server. The server is working fine, other sites are loading. However, this joomla site doesn't load. Please can someone explain what ...
2
votes
2answers
423 views

I am trying to connect two database with one Joomla site

I have two joomla site with different database.And I want to share all data one site to Another site .For example when I register A user in one website then it's updated on second site database also....
3
votes
2answers
2k views

Pass results (array) from controller into view and show it

I'm experimenting with creating my own Joomla component. The component searches records in database tables, but I have a problem with how to show them. I have a search form that sends the search ...
0
votes
1answer
27 views

Converting joomla 2x component compatible to joomla 3x

I am updating Joomla component to Joomla 3x but getting error on code. Code Line: $postData = $this->dr_parameters->app->session->get('errorPostData', array() ); Error: 0 Call to a ...
0
votes
1answer
228 views

Making Joomla 2.5 component compatible with Joomla 3

I have component in Joomla 2.5. I am trying to make it to compatible with Joomla 3.x. After few changes in the code, I get an error: Cannot extend from interface JController Then I change the ...
0
votes
1answer
28 views

Is it secure to add PHP Form processor in template?

I'm trying to build a custom form without any extension. And to do this I need to add a PHP form processor file in template templates/mytemplate/form/process.php Is it secure to add and call form ...
-1
votes
1answer
584 views

Change Value Of Multidimensional Array In Session

This will change a variable in the session $session = JFactory::getSession(); $session->set('name', "value"); But could you in the same way (directly) change any specific value of a session array?...
0
votes
1answer
590 views

How to avoid frequent spammers in my Joomla site [duplicate]

I have been experiencing spamming in my website for a long time, following are two things i want to stop - 1.stopping fake/bad user registration 2.stopping posting bad topics in my kunena forum I ...
-1
votes
2answers
55 views

Is it possible to load one module only after the whole page has loaded?

On my site, one module is taking considerably longer to load than the other content on the page. I'm wondering if it's possible to delay the loading of this module? For example, after the page is ...