1

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

3 Answers 3

1

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.

Sign up to request clarification or add additional context in comments.

Comments

0

You could call the page directly using a web request like feature of PHP.

1 Comment

Agreed, I wouldn't use the method myself, but I answered the question as asked. I can't understand why he wants to do what he is doing and I hoped the mess of the method that would work would steer him toward the best solution (writing a widget in PHP that interacted with the database directly).
0

Since you have allow_url_fopen I believe you can do this:

print file_get_contents('http://siteurl/GetHeader.aspx?l=en');

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.