Wuu Posted February 20, 2008 Report Share Posted February 20, 2008 Telnets izraisa erroru ja programma nav ieslēgta :( $ip = 'localhost'; $port = 2593; $telnet=fsockopen($ip,$port,$errno,$errstr,30); if (!$telnet) { $online = '<img src=\'style/off.gif\' alt=\'on\'> <font color=\'red\'>Offline</font>'; } else { $online = '<img src=\'style/on.gif\' alt=\'on\'> <font color=\'green\'>Online</font>'; fclose($telnet); } Viss kārtībā ja programma ir ieslēgta ,bet ja nav tad Warning: fsockopen() [function.fsockopen]: unable to connect to localhost:2593 (Connection refused) in /home/main/www/top_menu.php on line 6 Kā lai pārbauda vai programma ir ieslēgta vai nē? Link to comment Share on other sites More sharing options...
Aleksejs Posted February 20, 2008 Report Share Posted February 20, 2008 Pamēģini šitā: $telnet=@fsockopen($ip,$port,$errno,$errstr,30) Link to comment Share on other sites More sharing options...
Wuu Posted February 21, 2008 Author Report Share Posted February 21, 2008 Senx strādā ,bet ko tieši šis @ dara? Link to comment Share on other sites More sharing options...
Delfins Posted February 21, 2008 Report Share Posted February 21, 2008 (edited) errorus nemet. Vispār izmanto pēc iespejas mazāk... tikai šādiem gadījumiem, kad nav iespējams izvairīties bez ob_end_clean() Edited February 21, 2008 by Delfins Link to comment Share on other sites More sharing options...
Recommended Posts