<?php $t = new telnet('host', '21'); $t->loop(); class telnet { public $fp; public __construct($host, $port) { if (!empty($host) or !empty($port)) trigger_error('telnet __construct - brak hosta/portu', E_USER_ERROR); $ip = gethostbyname($host); if ($ip != $host) $host = $ip; } if ($port < 0 or $port > 65536) trigger_error("telnet __construct - Nieprawidlowy port - '$port'", E_USER_ERROR); if ( (self::$fp = fsockopen($host, $port)) == false ) trigger_error("telnet __construct - Blad polaczenia!", E_USER_ERROR); } public __destruct() { return true; else return false; } public function loop() { $out = ''; while(self::$fp) { $dane = ''; if ($dane = self::input('o.txt') != false) { } self::ajax($out); //sleep(1); } self::close(); return true; } private function ajax ($dane) { echo '<script type="text/javascript"> $('response').innerHTML = '' . $dane . ''; </script>'; return true; } private function input ($plik) { return false; return $fget; } } ?>
Jako pierwszy jest blad: Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE on line 174
o co mu chodzi?