简体   繁体   中英

can I get php to run in an asp.net page?

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?

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.

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.

查看Phalanger ,它是CLR的PHP编译器

可以使用ASP.NET从php服务器加载页面内容...不是一个好主意,但是在技术上是可行的。

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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM