I want to include external PHP script in Magento CMS Pages
e.g.
**http://myhost/magento/custom/script.php**
<?php echo "hello"; ?>
Result on Magento Page should be: "hello"
What would be the simplest way to do this?
The best way would probably be via the Layout Update XML section (on the design tab). You can either create a new block for your template php file, or use Mage_Core_Block_Template. Add this:
<reference name="content">
<block type="core/template" name="my_template" template="pat/to/your/template" after="cms_page" />
</reference>
OR
You can use curly braces syntax in order to include .phtml file where you can write your PHP code as:
{{block type="core/template" name="my-template" template="path/to/your/template.phtml"}}
Thanks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With