I have a PHP script that we might use for popping weather info on the page, but how do you include a php page in a matrix setup? When I use the content types of raw HTML or code, those don't work. Is there something simple to select to allow simply a paste of php code?
Ta,
Deb
How do you include a PHP script?
For security reason, user's custom PHP code is not allowed to be entered or executed by Matrix.
You can only host the PHP script somewhere else, and Matrix will treat it as an external page.
If you are able to host the PHP file elsewhere, you can then use the Remote Content Page asset. It will basically nest the php content within Matrix. It is actually a very nice solution!
http://manuals.matrix.squizsuite.net/remote-content
If you are able to host the PHP file elsewhere, you can then use the Remote Content Page asset. It will basically nest the php content within Matrix. It is actually a very nice solution!
http://manuals.matrix.squizsuite.net/remote-content
Is there a way to host a PHP file on the same server as Matrix and so that it can use the same URL?
I've got a PHP file that I would like to upload and call a web service and it uses PHP to communicate with the service and the results are returned in-page via AJAX. So placing the PHP on another domain calls up an "Access-Control-Allow-Origin" error, and using the Remote Content asset to files on the same domain is only returning "Content cannot be accessed".
Is there a way to host a PHP file on the same server as Matrix and so that it can use the same URL?
I've got a PHP file that I would like to upload and call a web service and it uses PHP to communicate with the service and the results are returned in-page via AJAX. So placing the PHP on another domain calls up an "Access-Control-Allow-Origin" error, and using the Remote Content asset to files on the same domain is only returning "Content cannot be accessed".
Yes, you need to create a physical folder on your web server for this, and add it as an Alias line in the relevant <vhost> section of your apache config file, which will make Apache serve any PHP files from that folder directly. You'll already have entries for /__data and /__lib which point to parts of your Matrix installation as examples.
Yes, you need to create a physical folder on your web server for this, and add it as an Alias line in the relevant <vhost> section of your apache config file, which will make Apache serve any PHP files from that folder directly. You'll already have entries for /__data and /__lib which point to parts of your Matrix installation as examples.
Thanks Peter. Does it need to be placed before or after the Matrix entries, or does order of these lines not matter?
Thanks Peter. Does it need to be placed before or after the Matrix entries, or does order of these lines not matter?
I always put it before.