ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Inserting EE content into a non-EE page

April 04, 2009 10:25am

Subscribe [2]
  • #1 / Apr 04, 2009 10:25am

    sfgolfer

    41 posts

    I have some php files that reside outside of EE.  I would like to insert some EE content into these php files.

    It works if I call the EE content via an iframe:

    <iframe src="http://domain/site/permalink/auto_stores"></iframe>

    I would prefer not to use an iframe if possible so I thought I would try it via php include or php require:

    <?php
    
    require("http://domain/site/permalink/auto_stores");
    
    ?>

    The result are these messages:

    Warning: require(http://domain/site/permalink/auto_stores) [function.require]: failed to open stream: HTTP request failed! HTTP/1.1 401 Access Denied in C:\Inetpub\expressionengine\firm\\index.php on line 80

    Fatal error: require() [function.require]: Failed opening required ‘http://domain/site/permalink/auto_stores’ (include_path=’.;c:\\php\\pear’) in C:\Inetpub\expressionengine\firm\index.php on line 80

    A similar message appears for either php include or php require.

    /firm/index.php is a non-EE page calling on the EE content.

    I enabled both allow_url_fopen and allow_url_include in my php.ini file.

    Navigating directly to http://domain/site/permalink/auto_stores does show the content.  The template used in this case is bare bones (title and body only).

    Any ideas?

  • #2 / Apr 09, 2009 8:51am

    silenz

    1651 posts

    Perhaps you have more luck with

    <?php
    readfile("http://domain/site/permalink/auto_stores");
    ?>
  • #3 / Apr 09, 2009 9:20am

    sfgolfer

    41 posts

    ‘readfile’ did not work either.  Still getting permission denied.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases