View Full Version : Synching an ASP.net system with PHP
thresher
07-23-2009, 12:03 PM
I think I know the answer to this, but I'll ask anyway.
I need to synch up a PHP website with an ASP.net booking system. Is there anyway the two languages can communicate with each other? How difficult is it to mesh the two languages? (Again I think I know the answer to this).
Any input is appriciated, sorry the info is a bit sparse.
Mike_O
07-23-2009, 06:39 PM
Hey thresher,
Don't know if this is what you're looking for, but you can create an assembly in .NET and use it in PHP. Here's an article:
http://www.devarticles.com/c/a/PHP/Using-the-.NET-Assembly-in-PHP/
Regards,
Mike
Old Pedant
07-24-2009, 01:59 AM
Personally, I'd do it all via a common database. Have both of them be able to connect to the same MySQL DB, for example.
And if you need to communicate from a PHP page to ASP.NET page, or vice versa, you do it by passing an encrypted id of some kind. Both sides know the encryption key (and nobody else does) and all they have to do is look up data in the DB after unencrypting the id (or whatever) that references the right DB record(s).
Even if you use an ASP.NET assembly in your PHP page, you wouldn't be able to share (for example) session data unless you used something like I describe above.
Mike_O
07-24-2009, 05:07 AM
Hey Old Pedant/thresher,
If it is the case when you can "mesh" everything via some common DB, then of course, you're right. However, one cannot assume that all the functionalities of this so-called "ASP.net booking system" necessarily involve connecting to a DB.
Another point is if everything really is DB-driven, and as long as the functionalities on the .NET side are not too complex, I would seriously consider just rewriting these functionalities in PHP and forgetting about combining PHP and .NET. This would also eliminate the example you mentioned of not being able to share session data.
thresher...perhaps you can go into a bit more detail of exactly what you want to achieve and what kind of
functionalities you have there.
Regards,
Mike
Old Pedant
07-24-2009, 06:18 AM
one cannot assume that all the functionalities of this so-called "ASP.net booking system" necessarily involve connecting to a DB.
<shrug>That's his choice, of course. There's no reason he couldn't share everything needed via a DB. Even if some of the stuff shared is only there for the purpose of (for example) sharing session state. Essentially, one could use the DB *as* the session state, with the encrypted identifier serving the same purpose that a sessionid cookie servers in a single-platform system.</shrug>
But, yes, if he has the option of moving to a single-platform system without too much rewrite grief, I'd probably take that path, were I he.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.