Search
Other Sourcerer questions
Forum

Questions about the PRO version

AJCS's Avatar AJCS
Hello
We have purchased the PRO version and we have seen that they have the option to add a URL to a PHP file.
The question is whether when inserting this url, it will work as if it were an IFRAME or not.
We have a PHP that lists the files in the folder.
We want it to be able to run without this PHP and we don't know if it is possible.
Thank you
Peter van Westen's Avatar Peter van Westen ADMIN
No, it will include the file.

See: docs4.regularlabs.com/sourcerer/the-basics/including-files
Please post a rating at the Joomla! Extensions Directory
AJCS's Avatar AJCS
OK thanks

another question regarding this topic.

If we have an html file and we want to include it in a module, how should we do it?
The file via URL works.
With this code should it be displayed?
{source}<?php
    echo file_get_contents( JPATH_SITE.'https://mypage.com/index.html' );
?>{/source}

It just gives me the feeling that it's like calling an iframe, but I can't...
Do you have examples to see the PHP files that can be included and to download them and try it?
thank you
Peter van Westen's Avatar Peter van Westen ADMIN
Please read this again:
docs4.regularlabs.com/sourcerer/the-basics/including-files

You should give the path to the file, not the URL.
Please post a rating at the Joomla! Extensions Directory
AJCS's Avatar AJCS
Hello again
Yes, I understood what you are telling me. I put the file inside the same folder without URL.

But the question I have is...
I have a PHP that works on this same site, if I call it directly, for example: hosting.com/index00.php

If I use this PHP in the same folder, should it be displayed?
{source php="/index00.php"}{/source}

does not show errors. I understand that it finds the file, but it doesn't show anything.
Greetings
Peter van Westen's Avatar Peter van Westen ADMIN
You can't just include any stand-alone php file.
See: docs4.regularlabs.com/sourcerer/the-basi...-document-structures

Please read the full documentation there.

Also, as the documentation suggests, if the file would be in the root of your site (which is not recommended), it would be:
{source php="index00.php"}{/source}

If you do not know how PHP works, I do not recommend you use a tool like Sourcerer.
Please post a rating at the Joomla! Extensions Directory
AJCS's Avatar AJCS
The folder where the file is works fine.
If I put an HTML there is no problem

But if I put a php, it gives me errors.
I don't know if it's because of the configuration of the php file or what the reason is.

Maybe they are functions that are not supported on this system.

I don't understand PHP. For this reason I asked if they have examples.
In the end this module is to embed code in Joomla, which if we put it in an article it does not work. No?

Thanks, we will continue trying things.
Peter van Westen's Avatar Peter van Westen ADMIN
Sorry, it is outside my support to try and explain how php works, or to bugfix your custom php code.

There is a difference between php as a stand-alone file and placing (including) php code in a php framework (like Joomla).

You might want to use an iframe instead for what you need.

Otherwise, let someone look into it that does know how php works.
Please post a rating at the Joomla! Extensions Directory
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription