views:

220

answers:

5

I'm trying to allow my php pages to run inside a content page of the master page. I'd like to run php somehow inside a master page. Besides frames is there another way? I've read you can use a frame, but would prefer not to. If I have to go with frames to get it done, should I be using an asp.net frame class of some sort or the raw html type?

+3  A: 

Well, there's always Phalanger for running PHP within the .NET framework, but I recommend against mixing environments like that.

If your PHP pages live on a different server, frame them. If you must have them on the same server, Phalanger them.

In both cases, I suggest you take a good, long, hard look at what you're doing and try to find another way.

Randolpho
the CLR was built to support polyglot programming, so i don't really know that phalanger constitutes mixing environments.
Tim Hoolihan
PHP has a large reliance on a native library that Phalanger must either call directly or emulate. If they call it directly, it's a mixed environment -- the PHP libraries are almost all written in native C. If they emulate them, you're right, it's not a mixed environment. But using PHP with ASP.Net *is* a mixed up way of doing things.
Randolpho
good point. i looked into this, i checked their info site though (http://php-compiler.net/doku.php?id=core%3aoverview) and they implement the library in managed languages.
Tim Hoolihan
+1  A: 

Check out Phalanger, a php compiler for the CLR

Tim Hoolihan
A: 

Unfortunately, you won't be able to get php to run within an ASP.NET page. You can run PHP on an IIS7 install, but it would have to be separate pages, and I don't think that things such as application or session state are transferrable (you would have to store all of that externally, in a DB for example).

casperOne
+2  A: 

First, this is a really bad idea.

Second, if you really want to compound the bad idea, use frames or iframes. Of course, I hope you don't have Safari clients.

UPDATE:

Okay, I can think of ONE way. Do an http request for the php page during execution of your ASPX page. Filter out everything you don't need and inject the rest.

However, I still stand by my statement about this being a bad idea and believe you are better off throwing the PHP stuff away. The reason being that the next step in your quest will be to post data back from the php to the .net app; then it really starts going downhill.

Chris Lively
+1 very funny...
Paul
I dunno why you got dowmnodded; you're absolutely correct.
Randolpho
+1  A: 

You could load the page content from the php sever using ASP.NET...not a good idea, but technically possible.

Paul