Advertisement
kwachu

Untitled

Jun 11th, 2015
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.86 KB | None | 0 0
  1. <?php
  2. set_time_limit(0);
  3.  
  4. require_once("./conf/config.php");
  5.  
  6. $socket = fsockopen($server,$port,$errstr,$errno,2);
  7. stream_set_blocking($socket,0);
  8.  
  9. sendserv("PASS :$server_pass");
  10. sendserv("NICK $nick");
  11. sendserv("USER $ident - - :$realname");
  12. while(true) {
  13.     $data = fgets($socket);
  14.     echo $data;
  15.     $data_ = explode(' ', $data);
  16.     if($data_[0]=="PING"){
  17.         sendserv("PONG " . $data_[1] . "\n");
  18.     }
  19.     if ($data_[1]=="001") {
  20.         sendserv("Mode " . $nick . " +" . $modes);
  21.         sendserv("JOIN " . $channel);
  22.     }
  23. }
  24.  
  25. $polaczenie = @new mysqli('localhost', 'root', 'haslo', 'baza');
  26. if (mysqli_connect_errno() != 0){
  27.     echo("Nie połączono :" . mysqli_connect_error() . "\n");
  28. }
  29. else {
  30.     echo("Połączono.\n");
  31. }
  32.  
  33. function sendserv ($sendstring) {
  34.     global $socket;
  35.     fputs($socket, $sendstring .  "\n");
  36.     return(1);
  37.     };
  38.  
  39.  
  40. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement