Comments

I have installed the plugin and is working with the examples you gave( simple php). I tried to insert code with php, html, and javascript and css. It is not showing any errors but on publishing it is just displaying the code only( except the php code ). How to correct it>

I have worked it out. PHP, HTML, Javascript all are working. My only problem is that my form inserts the form data into mysql table.But that is not working. Any customization i have to do in Directphp.php file for the database related code to work.

Hi, i am trying to install a latest events php file in a cusstom module, using bot_jcalpro_latest_events.phpAll the events have been entered in the calendar and are visible on the website, but i can't get the php file to work in html. Am i using the right one, if so what am i doing wrong?

I installed DirectPHP on my Joomla! 1.5.22 site and tried it. Unfortunately it doesn't work. When I save the article, the is converted to ?-->. I activated the plugin and checked the TinyMCE settings to match the advised settings but still it doesn't work. How can I resolve this?

I installed DirectPHP on my Joomla! 1.5.22 site and tried it. Unfortunately it doesn't work. When I save the article, the "" is converted to "?-->". I activated the plugin and checked the TinyMCE settings to match the advised settings but still it doesn't work. How can I resolve this?Hope anyone can help

Unfortunately my question is not clear because the php tags are removed when I post on this forum. I'm trying to say that the php tags are modified by addition of !-- The php tag then looks like this (without spaces) < !-- ? php Hope my question is clear.....

Based on your description, looks like you've only installed the DirectPHP module.

For the module to work, it needs the DirectPHP plugin available here: http://www.kksou.com/php-gtk2/Joomla/DirectPHP-plugin.php

Please install the plugin and test the plugin by creating a new article and entering the PHP code in the article. (please follow the instructions as outlined in the article where you download the plugin).

Once the plugin is working correctly, you can then test your code in the module.

Unfortunately my question is not clear because the php tags are removed when I post on this forum. I'm trying to say that the php tags are modified by addition of !-- The php tag then looks like this (without spaces) < !-- ? php Hope my question is clear.....

Unfortunately my question is not clear because the php tags are removed when I post on this forum. I'm trying to say that the php tags are modified by addition of !-- The php tag then looks like this (without spaces) < !-- ? php Hope my question is clear.....

I am also experiencing this problem. Is there a workaround?

You can solve this by selecting "No Editor" in the Joomla General settings. Put the php-code in the article and save the article. Afterwards you can select TinyMCE again. But if you edit the page with php-code you must select "No Editor" again.

Hello kksou, thank you for your plugin! I am having a weird problem with DirectPHP 2.5 under Joomla 2.5.7.

I edit my articles at the backend, and for most PHP code, if I embed it in an article and press save, it makes the backend crash. However, the article was saved correctly: it displays on the web and the and the embedded PHP works right.

I get the feeling that the process of saving the article is attempting to execute the embedded PHP snippets at that very moment, instead of just saving them as HTML or text. Could this be happening?

Hello kksou. I have tried changing editor, but the same happens. Even when I select "no editor", which reduces input to a text box.

What happens is this:- I copy the text to the input box- I press save- The page becomes blank- I can still press "back" on the browser, and I get to continue working at the backend- If I go to the web and see the article, it displays and its embedded PHP worked as expected.

So, I tried deactivating DirectPHP. I re-saved some articles that normally made the backend go blank, and they saved without problems. When re-enabling DirectPHP, saving them again with the exact same content produces the problem again.

At the beginning of onContentPrepare function I have added the following 2 lines:

if( !JFactory::getApplication()->isSite() )return true;

This restricts PHP code evaluation to the site (and not the backend). So it seems that my intuition was right here: PHP was getting evaluated when saving the article! Hope you can fix it for next versions. And thanks for your help.

It's strange, because no other users have encountered this before. You can try this on a standard Joomla template. Don't think by default the editor will run the plugins. DirectPHP is a content plugin. It should run only with content articles.

In any case, this is still useful knowledge to know. It will benefit other users if they encounter similar situation.

What made me think that, is that the crash didn't happen for all PHP code. Depending on what instructions I added to the article, it would crash or not. That's what made me suspect: For a content string, what difference would it make if my PHP is calling echo or JFactory? None. Unless the PHP insertions are getting treated as code instead.

But I may be wrong, of course. Just letting you know my thoughts on the crash.

I am trying to run sql commands and none of them seem to work.Something as simple as creating a table with one column in it. I am not getting any errors and I am able to connect to the database but I can't do anything else.

1) Try echo "test123" first. Does it work?yes I have "Now is: " working

2) If yes, then trying echo some debugging messages to see at which point it doesn't work.

3) How do you know that you are able to connect to the database? I was using "(mysqli_connect_errno())" to check for errors

4) If you are able to connect to the database, then what is not working?This is the proverbial question. Unfortunately I am trying to teach myself php and sql so there is a little bit of a learning curve.

5) You might need to set error_display in php.ini to display error messages.

Hi, I am using your plugin for PHP code in a joomla article and it is working perfectly except one thing... the main navigation of the website is not showing on this page????please see:http://www.net-direct-marketing.com/index.php/ad-formAny ideas as how to fix this or why it is happening?

Hi thereThe plugin worked when I first installed it. Today it won't work. The .php script is shown in full in the content. Using TinyMCE in Joomla 2.5.14 and PHP 5.3. Like I said, it worked a couple of days ago. Nothing changed on the site....John

i am using DirectPHP plugin in zoomla version 3.0 but when i create page by sppage builder and write php code . its not working . when i check code on browser in inspect element php code show in comment .\

The DirectPHP plugin is a content plugin. As the name suggests, it's for use within the Article component only (which is com_content). I wrote this plugin to run simple PHP commands from within an article. It's not designed to run in other components.

The SP Page Builder is a different component by itself. It does not know all the plugins out there, and naturally it will not run DirectPHP plugin which is a content plugin.

You might want to check with the developer of SP Page Builder to see if there's anyway to trigger content plugin from within their component.

I am (still) using this wonderful little tool in various projects to add php into content - as said before, I really like it!!!

However, for your info, just in case you did not yet notice the following DEPRECATION message (on PHP 7.0.7):

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; plgContentDirectPHP has a deprecated constructor in ....httpdocs/plugins/content/DirectPHP\DirectPHP.php on line 23

Hello Iddy,I am a longterm (very happy) user of "DirectPHP". However for getting data out of your database and embed them into articles, you may want consider my own Joomla extension jDBexport. This is a data reporting tool, where you define SQL queries in the backend, and receive the results as Excel documents (or embed them in just about any way you want).contact me if you like to know more...regards Ruediger

Hi there,I am using your DirectPHP Plugin and it worked all fine so far. Thanks so much for providing this Plugin. However, I have no experienced a problem with PHP Mail function. Within an article I have implemented code to generate an email and send it out via Mail(). Once processing the script, nothing is happening. I am not receiving any error message, but an email has also not been sent. First I thought it could be a missing email address which I have taken out from an mysql table, but I checked this and the query worked fine and e-mail address ist correct.

Do you have any idea what the problem could be? Just for your information: The DirectPHP Plugin is ordered before the Content - Email Cloaking.

There's no way to fix anything if you don't know exactly what's the problem. So first thing first, you need to find out what is the error message.

Joomla has no inherent debugging tool. So the only way is to enable error_display in PHP and see what exactly is the error message produced.

Also DirectPHP uses standard eval() function. So you can also copy and paste the entire code into a standalone .PHP file and see if it runs from browser or command line. If it doesn't, you can see exactly what's the error message on the screen.