tags:

views:

155

answers:

2

So I'm going to bild a simple PHP CMS. I need to know how should I bild it to be able to call its functions from .NET WPF application. And how to call PHP functions and send forms from WPF .NET application...

BTW: I'm going to have users with passwords that would need some form of autentication. after which they'll need to call that functions

SO how to call php functions from .NET WPF application?

A: 

Why not go the MVC-url approach:

mysite.com/function-name/[param1/][param2/][param3/]...

So calling mysite.com/getRegDate/2332 would call:

function getRegDate($userid) {
  return "2009-01-01"; // logic to get date
}

Returning the date-text in the response.

Jonathan Sampson
And how to do such thing if I need to manage simple password protected accounts?
Blender
+2  A: 

If I understand your question correctly you would simply have your WPF application request your PHP script just like any other web page. Send your post/get vars to the PHP app, have it run the necessary operations, and then whatever PHP 'prints' to the screen should be captured by WPF for processing.

You will just need to be sure that the PHP scripts are web accessible. If you want to get really fancy with it you could open a socket between WPF and PHP for continuous communication, but your CMS model will really dictate whether or not that is necessary.

angryCodeMonkey