ecco il codice di ajax_command.
Per completezza di informazione ti dico che la possibilità di scrivere nella shout è limitata a pochi lettori, mentre dati alla mano, tutti (circa 3000) leggono contemporaneamente.
Ancora grazie mille... se non trovo la soluzione mi chiudono il sito...

<?
// PROGRAM ajax_shout.php //
/*
* This program is a very ugly but simple php/AJAX implementation of
* a chat program..
*
* Permission to use and modify is granted to the public domain so
* long as they leave my contact info intact. If you wish to contribute
* changes feel free to drop me an email and notify me. Permission is NOT
* granted for this to be redistributed by itself.
*
* (c)opyright irbobo (happysap -NOSPAM- at -NOSPAM- gmail.com)
* http://thedevnet.com
*/


ignore_user_abort(true);
@ob_start();
include_once('shoutbox_data.php');

function HTTPStatus($num) {

static $http = array (
100 => "HTTP/1.1 100 Continue",
101 => "HTTP/1.1 101 Switching Protocols",
200 => "HTTP/1.1 200 OK",
201 => "HTTP/1.1 201 Created",
202 => "HTTP/1.1 202 Accepted",
203 => "HTTP/1.1 203 Non-Authoritative Information",
204 => "HTTP/1.1 204 No Content",
205 => "HTTP/1.1 205 Reset Content",
206 => "HTTP/1.1 206 Partial Content",
300 => "HTTP/1.1 300 Multiple Choices",
301 => "HTTP/1.1 301 Moved Permanently",
302 => "HTTP/1.1 302 Found",
303 => "HTTP/1.1 303 See Other",
304 => "HTTP/1.1 304 Not Modified",
305 => "HTTP/1.1 305 Use Proxy",
307 => "HTTP/1.1 307 Temporary Redirect",
400 => "HTTP/1.1 400 Bad Request",
401 => "HTTP/1.1 401 Unauthorized",
402 => "HTTP/1.1 402 Payment Required",
403 => "HTTP/1.1 403 Forbidden",
404 => "HTTP/1.1 404 Not Found",
405 => "HTTP/1.1 405 Method Not Allowed",
406 => "HTTP/1.1 406 Not Acceptable",
407 => "HTTP/1.1 407 Proxy Authentication Required",
408 => "HTTP/1.1 408 Request Time-out",
409 => "HTTP/1.1 409 Conflict",
410 => "HTTP/1.1 410 Gone",
411 => "HTTP/1.1 411 Length Required",
412 => "HTTP/1.1 412 Precondition Failed",
413 => "HTTP/1.1 413 Request Entity Too Large",
414 => "HTTP/1.1 414 Request-URI Too Large",
415 => "HTTP/1.1 415 Unsupported Media Type",
416 => "HTTP/1.1 416 Requested range not satisfiable",
417 => "HTTP/1.1 417 Expectation Failed",
500 => "HTTP/1.1 500 Internal Server Error",
501 => "HTTP/1.1 501 Not Implemented",
502 => "HTTP/1.1 502 Bad Gateway",
503 => "HTTP/1.1 503 Service Unavailable",
504 => "HTTP/1.1 504 Gateway Time-out"
);

header($http[$num]);
}


//string insens_replace($haystack,$needle,$replacewith) - case insensitive replace function
function insens_replace($needle,$replacewith,$haystack)
{
static $recursed=FALSE;
static $beginpart='';
static $endpart='';

if(($pos=strpos(strtolower($haystack),strtolower($ needle)))!==FALSE)
{
$recursed=TRUE;
$beginpart.=substr($haystack,0,$pos).$replacewith;
$endpart=substr($haystack,$pos+strlen($needle));
return insens_replace($endpart,$needle,$replacewith);
}
else
{
if($recursed)
{
$result=$beginpart.$endpart;

$recursed=FALSE;
$beginpart='';
$endpart='';

return $result;
}
else
{
return $haystack;
}
}
}

function shoutbox_shout($MESSAGE)
{
global $SHOUTBOX;

$MESSAGE = str_replace("-",'ASH:', $MESSAGE);

// take out anything that isn't A-Z,a-z,0-9
$MESSAGE = ereg_replace('[^a-zA-Z0-9 ,.?!:#+*&)(|\'"]',"",$MESSAGE);

// trim excess whitespace...
$MESSAGE = preg_replace('/\s+/', ' ', $MESSAGE);
$MESSAGE = trim($MESSAGE);

// replace bad words...
$MESSAGE = insens_replace('poker','', $MESSAGE);
$MESSAGE = insens_replace('viagra','', $MESSAGE);
$MESSAGE = insens_replace('pill','', $MESSAGE);
$MESSAGE = insens_replace('pthc','', $MESSAGE);
$MESSAGE = insens_replace('preteen','', $MESSAGE);
$MESSAGE = insens_replace('childporn','',$MESSAGE);
$MESSAGE = insens_replace('kiddy','', $MESSAGE);
$MESSAGE = insens_replace('kiddi','', $MESSAGE);
$MESSAGE = insens_replace('kid','', $MESSAGE);
$MESSAGE = insens_replace('children','',$MESSAGE);
$MESSAGE = insens_replace('child','', $MESSAGE);
$MESSAGE = insens_replace('teeny','', $MESSAGE);
$MESSAGE = insens_replace('http','', $MESSAGE);
# should render the .com's ,etc. to uselessness
$MESSAGE = insens_replace('.com ',' ', $MESSAGE);
$MESSAGE = str_replace('://','', $MESSAGE);
$MESSAGE = str_replace('.','. ', $MESSAGE);
$MESSAGE = str_replace('.com ',' ', $MESSAGE);


// $MESSAGE = str_ireplace('','---',$MESSAGE);

$MESSAGE = str_replace('ASH:','-',$MESSAGE);

// trim message down to 255 characters...
if(strlen($MESSAGE) > 255) $MESSAGE = substr($MESSAGE,0,255)."...";

$MESSAGE = str_replace('&','&#38;',$MESSAGE);
$MESSAGE = str_replace('"','&#34;',$MESSAGE);
$MESSAGE = str_replace("'",'&#39;',$MESSAGE);


if(!@empty($MESSAGE))
{

if (!isset($SHOUTBOX)) $SHOUTS = 0;
else if(count($SHOUTBOX) >= 80) $SHOUTS = 79; // MAX DISPLAYED SHOUTS...
else $SHOUTS = count($SHOUTBOX);

// add latest message to $SHOUTBOX array //
$TEMP_ARRAY[] = array("msg" => $MESSAGE, "userip" => $_SERVER['REMOTE_ADDR'], "time" => time());
// ADD in the old shouts...
if($SHOUTS > 0) for($i=0;$i<$SHOUTS;++$i) $TEMP_ARRAY[] = $SHOUTBOX[$i];

$FCONTENTS = '<'.'?'."\r\n";

for($i=0;$i<count($TEMP_ARRAY);++$i)
{
$FCONTENTS .= '$SHOUTBOX[] = array(';
$FCONTENTS .= ' "msg" => "'.$TEMP_ARRAY[$i]['msg'] .'", ';
$FCONTENTS .= ' "userip" => "'.$TEMP_ARRAY[$i]['userip'] .'", ';
$FCONTENTS .= ' "time" => "'.$TEMP_ARRAY[$i]['time'] .'" ';
// build file string...
$FCONTENTS .= ");\r\n";
}

// array("key" => "value", ... ); //

$FCONTENTS .= "\r\n".'?'.'>';

$fp = fopen('shoutbox_data.php','w');
fwrite($fp,$FCONTENTS);
fclose($fp);
}
}

function t_delimit($SHOUTS)
{
$SCOUNT = count($SHOUTS);
for($i=0;$i < $SCOUNT;++$i)
{
echo $SHOUTS[$i]['msg']."~".$SHOUTS[$i]['time']."~".date("F j, Y, g:i a", $SHOUTS[$i]['time']);
if($i<$SCOUNT-1) echo "~";
else echo "\n";
}
}

function return_new_shouts($SHOUTS, $OLDTIME)
{
for($i=0;$i<count($SHOUTS);++$i)
if($SHOUTS[$i]['time'] > $OLDTIME)
$NEWSHOUTS[] = $SHOUTS[$i];

if(!@empty($NEWSHOUTS[0]['time'])) return $NEWSHOUTS;
}

switch(@$_GET['shout'])
{
case 'add':
$MESSAGE = $_POST['msg'];
shoutbox_shout($MESSAGE);
break;

case 'ashout':
$MESSAGE = urldecode($_GET['msg']);
shoutbox_shout($MESSAGE);
break;

case 'getshouts':
if(@empty($SHOUTBOX[0]['time'])) echo "NONE|";
else t_delimit($SHOUTBOX);
break;

case 'getnewshouts':
if($SHOUTS = return_new_shouts($SHOUTBOX, $_GET['time'])) t_delimit($SHOUTS);
else HTTPStatus(304);
break;
}

if(!@empty($_GET['shout']))
{
// header("location:".$_SERVER['PHP_SELF']);
die();
}

?>