Magento - include/require php file within phtml template file -



Magento - include/require php file within phtml template file -

in 1 of magento template phtml files trying include seperate php file. when include nil outputted , when utilize require instead next 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 error shows right url path , when go straight works - doesn't beingness included/required phtml template page.

i've tried next in phtml file (using magento's baseurl, absolute path , 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'); ?>

instead of mage::getbaseurl utilize $root = mage::getbasedir();

php magento include

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -