In one of my magento template phtml files I am trying to include a seperate php file. When I include it I get nothing outputted and when i use require instead I get the following error
Fatal error: require(): Failed opening required 'http://www.site.co.uk/dir/test.php'
(include_path='/home/usr/public_html/app/code/local:/home/usr/public_html/app/code/community:/home/usr/public_html/app/code/core:/home/usr/public_html/lib:.:/usr/lib/php:/usr/local/lib/php') in /home/usr/public_html/app/design/frontend/theme/edits/template/review/product/view/list.phtml on line 30
The first line of the error shows the correct url path and when i go to it directly it works - it just doesn't like being included/required from the phtml template page.
I've tried the following in the phtml file (using magento's BaseURL, absolute path and the relative path):
<?php
$root = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
require/include ($root.'dir/test.php');
?>
<?php
require/include ('http://www.site.co.uk/dir/test.php');
?>
<?php
require/include ('../../../../../../../../../dir/test.php');
?>