blackcell Posted June 11, 2008 Share Posted June 11, 2008 How would you plug something written into a different language into a php script? For instance a chat program written in C? Sorry if this is the wrong forum. Quote Link to comment Share on other sites More sharing options...
keeB Posted June 11, 2008 Share Posted June 11, 2008 Not the wrong forum but, when asking questions that are this unordinary, you really need to provide details so we can help. Normal questions -- we can usually discern what the intention is. This one, I cannot. Quote Link to comment Share on other sites More sharing options...
blackcell Posted June 11, 2008 Author Share Posted June 11, 2008 If I build something with another language how do I implement it into a web page? Do you have to do the interfacing method with the language you built it with? For instance, JAVA applications on websites. Are they built with the functions to tie into a web page with the Java language? Quote Link to comment Share on other sites More sharing options...
keeB Posted June 11, 2008 Share Posted June 11, 2008 Hmmmmmm.. I am pretty sure you can look up Java JNI to come up with a solution if you needed to, but generally if you want to hook 2 apps up you're going to need to provide some sort of way to interface. If you wanted to have a chatroom written in Java that a PHP script could work with, most likely what you'd do is set up (prototype): TcpIpConnection.java ChatRoomServer.java (And you'd have ChatRoom.java + friends for servicing the normal chatroom) ChatRoomServer would initiate a TcpIp Listen on port <x> and broadcast any events that happened in the chat room. Beyond doing some sort of integration like that, remember, any function provided by PHP is actually implemented in C/C++. You could write your own extension (like GD) that interfaces with your chat program, so that in PHP all you would have to do is like: chat_start(); #in some sort of ajax script print chat_poll(); Hope this makes sense. Quote Link to comment Share on other sites More sharing options...
blackcell Posted June 11, 2008 Author Share Posted June 11, 2008 Yep, thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.