Posted By

whitetiger on 11/09/06


Tagged

regex url php path htaccess web uri gzip crawler bots finger


Versions (?)

PHP - Finger PHP Simple Client


 / Published in: PHP
 

  1. <?php
  2. // Client di Finger
  3.  
  4. $fp = fsockopen('kernel.org', 79); // Si collega al seguente server nella porta 79
  5.  
  6. fputs($fp, '@kernel.org\n'); // Manda una richiesta
  7.  
  8. echo '<table border=\'0\' cellspacing=\'1\' cellpadding=\'1\' bgcolor=\'black\'>';
  9.  
  10. while( !feof($fp) )
  11. {
  12. $text = fgets($fp, 128); // Ritorna una risposta
  13.  
  14. if(trim($text) != '')
  15. {
  16. echo '<tr bgcolor=\'white\'>';
  17. echo '<td>';
  18. echo '<font face=\'Arial\' size=\'-2\'>' . trim($text) . '</font>';
  19. echo '</td>';
  20. echo '</tr>';
  21. }
  22. }
  23.  
  24. echo '</table>';
  25.  
  26. fclose($fp);
  27. ?>

Report this snippet  

You need to login to post a comment.