tags:

views:

44

answers:

2

Hello

I want to build an application written in C# that renders a webpage in a dialog. Simple enough there are lots of tutorials on how to do this http://www.codeproject.com/KB/cs/webbrowser.aspx

Now I want to render some PHP pages instead of static pages, mainly to configure a database (SQLIte) and add a few recored, ect. I don't want to have to run a separate webs server just for PHP

I was surprised when I could not find any PHP extension in CSharp.

Suggestions on how I can accomplish this?

+4  A: 

You can run the PHP CLI (command line interface) executable and use the output of this to display this in the web browser control. This is by far the easiest way to accomplish what you're looking for.

This executable is included in the download from PHP at http://windows.php.net/download/.

You can also try to communicate with the PHP DLL through interop, but this will be a lot more work.

Pieter
+2  A: 

You can connect to a SQLite database directly from C#. There is no need to have any PHP in your application at all. If your pages are simple I'd try porting the PHP to C# rather than having two separate systems.

From your brief description it doesn't sound like the PHP is doing anything too complicated so it probably won't take long to rewrite it in C# and the end result will be a cleaner solution that is easier to maintain.

Related

Mark Byers