-1

My company currently has a Linux server setup with a basic site that uses PHP to process some files and return data to the user.

Eventually, my boss wants me to remake it in .NET. But first, he wants me to just create a frontend for the PHP files.

It looks like all of the PHP files take parameters and return an HTML document.

What would be the best way to get this data so I can display it in an ASP.NET page?

ernest
  • 1,633
  • 2
  • 30
  • 48
  • You could probably work an asp server as a reverse proxy to the php server temporarily. Performance would probably suck though. – Jonathan Kuhn May 17 '13 at 15:56
  • 1
    this may help you: http://stackoverflow.com/questions/4761769/can-php-and-asp-net-run-together-within-the-same-web-site-in-iis-7-5 or this: http://forums.aspfree.com/web-layout-43/can-php-asp-go-same-page-56079.html – Potheek May 17 '13 at 15:59

3 Answers3

1

Short of parsing the html markup one way would be to modify the files such that they return data instead of rendered pages, e.g. as json or XML. Basically you would transform your php pages into a kind of web service.

Christoph Grimmer
  • 4,210
  • 4
  • 40
  • 64
1

Maybe it would be easier to have 2 web servers: one to run PHP (probably Apache) and one to run the ASP.net which should be IIS running on Windows.

You can have IIS and Apache running on the same physical Windows server but this is more difficult. It's easier to have 2 physical servers. Have a look at the PHP app to see what OS it runs on now. Trying to move it from Windows to Linux, or vice versa, will likely cause issues.

Then in the ASP.Net pages you can fetch HTML from the PHP application using guidance on this page.

But maybe you should tell your boss this is not the most sensible way to go about things.

Community
  • 1
  • 1
Annabel
  • 1,394
  • 14
  • 23
  • Thanks! They're on two different servers now. I'll look at that page and see what I can make of it. – ernest May 17 '13 at 18:01
0

No, you need a PHP engine to do that. ASP.NET does not recognize PHP.

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501