Reputation: 113
Here is the situation: I have an ASP.NET main site, with a Magento buy-online section. The .NET site contains the header with menus generated dynamically, and I have to reuse the same header in the Magento side of the site.
I can't just copy the HTML in a static block, since the menu items are generated dynamically from a Database. I tried using an Iframe, but I'm using superfish for the menus, so when the sub-menus show up they don't fit in the iframe, so we don't see the whole menu. So I tried using the php include, with both the following syntaxes: include("/GetHeader.aspx?l=en"); and include("http://siteurl/GetHeader.aspx?l=en"); but both fail to show anything, the page is just blank.
My php.ini is set to show errors and warnings and both allow_url_fopen and allow_url_include are set to On
Any idea on how to achieve what I'm trying to do?
Thank you
Upvotes: 1
Views: 1080
Reputation: 37700
Since you have allow_url_fopen
I believe you can do this:
print file_get_contents('http://siteurl/GetHeader.aspx?l=en');
Upvotes: 0
Reputation: 6965
I really don't think this is cleanly possible with a plain server stack. There might be something you could do if you have Varnish running using Edge Side Includes.
The PHP include
function is meant for including files during compile time through the file system. This means it doesn't perform any HTTP request and therefore does not run through the ASP.NET engine. That's why it doesn't work in the way you are using it.
Upvotes: 1
Reputation: 6111
You could call the page directly using a web request like feature of PHP.
Upvotes: 0