SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast Dreeass's Avatar
    Join Date
    Sep 2012
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question C# PHP Communication

    I don't really know how to start this thread, so I should start with the experience I have and then get to the question. Well, I'm a decent developer, still young and would like to start developing C# programs and make it communicate with PHP because there are so many more features to C# then there is to PHP and there are things that are impossible to do with PHP. Those things are the things I want to accomplish with C# and share the data with PHP.

    So I ask you, where do I begin? I have a decent understanding of programming but have no experience with C#, but I do know the basics of C++ and am good with PHP. There is a place where I have to start, books, sites, articles, whatever. But it would all mean a lot to me if you could help me out here. Thanks.

  2. #2
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,625
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    There are three approaches one could take here:

    1) Expose web services and talk over HTTP -- this is probably the sanest / safest / most flexibile option
    2) Use the database layer to share data, each app does it's own thing with it. Probably reasonable for legacy stuff, I wouldn't build something this way now.
    3) PHP5 is capable of talking directly to .NET code using the DOTNET class. Never have seen this one used in anger though.

    In all honesty, you really want to do #1 in almost all normal cases.

  3. #3
    SitePoint Enthusiast Dreeass's Avatar
    Join Date
    Sep 2012
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by wwb_99 View Post
    There are three approaches one could take here:

    1) Expose web services and talk over HTTP -- this is probably the sanest / safest / most flexibile option
    2) Use the database layer to share data, each app does it's own thing with it. Probably reasonable for legacy stuff, I wouldn't build something this way now.
    3) PHP5 is capable of talking directly to .NET code using the DOTNET class. Never have seen this one used in anger though.

    In all honesty, you really want to do #1 in almost all normal cases.
    Sorry for the late reply, but do you have any tutorial on how to talk over HTTP? Is it also possible to run it in a Linux environment, someone told me something about Mono and some sort of stuff but I'm not familiar with it and I know C# should only run on Windows.

  4. #4
    SitePoint Mentor NightStalker-DNS's Avatar
    Join Date
    Jul 2004
    Location
    Cape Town, South Africa
    Posts
    2,873
    Mentioned
    44 Post(s)
    Tagged
    0 Thread(s)
    C# can run on linux if you write it with Mono.

    Communicating via HTTP is as simple as making a HTTP post to a URL with GET or POST params. Then the script on the other side should be able to handle those params. You can google HttpRequest for examples in C#, there should be loads on the internet


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •