How do I insert a php file safely in Joomla

For Joomla! 3.x Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general

Moderator: ooffick

Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
Morissius
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Tue Oct 31, 2017 7:41 pm

How do I insert a php file safely in Joomla

Postby Morissius » Fri Dec 15, 2017 9:25 pm

Hey,

I want to click on a button, then send data to a php file on my Joomla website which would return some json-data. This isn't too hard outside of Joomla.

The question is: 'Where should I place the php file in Joomla and how do I refer to it while keeping my website secure'.

I imagine I somehow have to send it throught the index.php 'gateway' file and prevent php injection from the data I receive somehow. Any ideas?

User avatar
toivo
Joomla! Exemplar
Joomla! Exemplar
Posts: 9259
Joined: Thu Feb 15, 2007 5:48 am
Location: Nottingham, UK
Contact:

Re: How do I insert a php file safely in Joomla

Postby toivo » Sat Dec 16, 2017 6:13 am

If you cannot find a suitable extension from the Joomla Extensions Directory (JED) at https://extensions.joomla.org, you can develop an extension and follow the secure coding guidelines, documented at https://docs.joomla.org/Secure_coding_guidelines
Toivo Talikka, Global Moderator
my first programs were assembled and run in 16KB :)
troubleshooting smtp and other articles https://talikka.com/joomla

User avatar
pmleconte
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 118
Joined: Fri Mar 17, 2017 12:55 pm

Re: How do I insert a php file safely in Joomla

Postby pmleconte » Sat Dec 16, 2017 9:25 am

Hi,

If you transfer a php file, it will be used as a executable file by your server.

To prevent this, you have to change its extension, as a .txt file for example.

Pascal

Morissius
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Tue Oct 31, 2017 7:41 pm

Re: How do I insert a php file safely in Joomla

Postby Morissius » Sat Dec 16, 2017 4:15 pm

toivo wrote:If you cannot find a suitable extension from the Joomla Extensions Directory (JED) at https://extensions.joomla.org, you can develop an extension and follow the secure coding guidelines, documented at https://docs.joomla.org/Secure_coding_guidelines

Thanks, those secure coding guidelines are very useful and clearly documented.


Return to “Joomla! 3.x Coding”

Who is online

Users browsing this forum: No registered users and 2 guests