Hello, I have been banging my head trying to figure out how to design a MUD
Server using PHP-CLI as the server and PHP-CLI as the "command" language.
(telnet front end at this point)

I have found the great Pear Net_Server which seems to work really good for
Alpha and the Forking Mode is great to really take advantage of threading
etc... I can of course exec("external.php") to run the external commands

but.... 

The real problem is full interaction with the user in those external
commands (php-cli scripts) to send and read data.

For example:

The PHP-CLI Server gets the command "bank" so it runs the PHP-CLI shell
script "bank.php" using $r = exec("bank.php"). The "bank.php" shell script
has the following code

#!/usr/local/bin/php -q
<?
// not really tested just a example

Function input () {

// some how get input from the user

}

$balance = 123.45

Echo "You have ".$balance; // some how send this out before the script ends
Echo "How much would you like? "; // this to

$howmuch = input();

$balance -= $howmuch;

Echo "You have ".$balance." Left";

?>

A. How do I create a input method to connect the external PHP script to the
Server's Socket?

B. Since the PHP-CLI script never ends how can I send the first echo "You
have..."?

Any Ideas??? Heck I havn't even gotten to ncurses yet!

BTW platform UNIX-OS X+PHP 5 --with-ncurses --enable-pcntl --mysql
Going for 100% PHP-CLI

D Myers

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to