![]() |
|
|||||||
|
|
Thread Tools | Search this Thread | Rate Thread |
|
#1
|
||||
|
||||
Running interactive console programs through the browserI remember this place being very helpful a few years ago, so this is the first place I thought of when I ran into this problem.
I'm doing independent study this semester (actually a third one-month semester; my university is a bit weird). The professor that I'm working with requires exactly what I've stated in the title. I know it's possible; I've seen AJAX terminal emulators, but I don't need something that complex. I'm pretty fluent in PHP, javascript, and the AJAX technique, but I'm really unsure where to start here. I know that, short of writing a terminal emulator, I need to find some way to redirect I/O to the browser, but I don't think piping is the answer. Perhaps the best example of this I can think of is here. They sort of trick the browser into thinking that the page never fully loads, which allows instantaneous response to commands via AJAX. I know that this is complex, but I would appreciate even a nudge in the right direction. It doesn't matter if this is done "right" or "well." My professor requires a quick-and-dirty solution, if you will. Thanks in advance. __________________
Pursue everything! P.S. This is what you would get at some point in the alphabet with the removal of the Q and R. |
||||
|
#2
|
|||
|
|||
Re: Running interactive console programs through the browserI would just have two ajax function, one for sending messages and one for requesting existing messages.
so when you send your message, you'll immediately change the innerHTML of your display to : document.getElementById("ChatWindow").innerHTML += "<br/>"+<font>document.getElementById("userInput").valu e+"</font>"; then have the AJAXSENDMESSAGE function that sends your message to the server and stores it in a database along with your client name (which can be assigned by an ajax function that overrides the body onload().). so you could have a send message table, along with a unique id, and then a received message table along with a unique Id. Then you could just say ok, if this is an incoming message, insert it into the sendmessage table along with the message and client name. now it is time to see if any of the sendmessages in the sendmessages have not been recieved by this client. if so, write the response of the messages (in html) and store the messages along with the client name in the table messagesrecieved so that next time you send a message, you won't get messages that you already recieved. and if I were you, I would have a timed AJAX function that constantly requests fromt that php (or any other server sided script page) to see if any new messages have came in. checking when you send is just extra, and probably you can do with out. This is the way I would do it "quick and dirty". Justin Fox |
Recent GIDBlog
Once again, no time for hobbies by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| win32 CreateProcess(), STARTUPINFO not working well for 98 console | Howard_L | C Programming Language | 0 | 10-Aug-2007 00:33 |
| running my programs EXE from VB will not "printf" to screen | sharikon | C++ Forum | 3 | 18-Dec-2006 08:29 |
| need help with a console menu system | BullBuchanan | C++ Forum | 6 | 20-Aug-2006 15:46 |
| win32 file opening and running other programs | Tomb332 | C++ Forum | 1 | 17-Aug-2006 09:53 |
| Running several Programs at the same time | expi12 | C Programming Language | 2 | 02-Jan-2006 01:30 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The