Wuu Posted February 20, 2008 Report 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ē?
Aleksejs Posted February 20, 2008 Report Posted February 20, 2008 Pamēģini šitā: $telnet=@fsockopen($ip,$port,$errno,$errstr,30)
Wuu Posted February 21, 2008 Author Report Posted February 21, 2008 Senx strādā ,bet ko tieši šis @ dara?
Delfins Posted February 21, 2008 Report 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
Recommended Posts