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

我的未来我决定 提交于 2019-12-11 07:45:59

问题


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?


回答1:


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.




回答2:


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.




回答3:


Check out Phalanger, a php compiler for the CLR




回答4:


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




回答5:


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



来源:https://stackoverflow.com/questions/1060081/can-i-get-php-to-run-in-an-asp-net-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!