Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Connect IRC using php on linux systems
#1
Hello SF Victoire

This script is created to be used for connecting to IRC clients using PHP on a linux system.

PHP Code:
<?
function phpbot($server$port$user$nick$realname$channel) {
  
$sockname fsockopen($server$port$errno$errstr) or exit("$errno $errstr");
  
$repeat "0";
  while (
$sockread fgets($sockname512)) {
    
$sockread explode(" "$sockread);
    if (!
$repeat) {
      
fputs($sockname"USER $user x x :$realname\n");
      
fputs($sockname"NICK $nick\n");
    }
    if (
$sockread[0] == "PING") {
      
fputs($sockname"PONG :$sockread[1]\n");
    }
    if (
$sockread[1] == "001") {
      
fputs($sockname"JOIN $channel\n");
    }
    if (
fnmatch("43?"$sockread[1])) {
      
fputs($sockname"NICK $nick".str_repeat(mt_rand(09), 3)."\n");
    }
    
$repeat++;
  }
}
?>
<html>
<center>
<input type="button" onclick="<?=phpbot("irc.kingskrown.com","6667","phpbot","phpbot","phpbot","#kingskrown");?>" value="Connect"/>
</center>
</html> 

That's it Smile Enjoy
Reply


Messages In This Thread
Connect IRC using php on linux systems - by immi - 10-13-2009, 02:27 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  PHP Framework List: An Ultimate Guide to 102 PHP Frameworks for Web Developers tk-hassan 0 941 07-27-2020, 11:26 PM
Last Post: tk-hassan
  PHP Video Tutorials (PHP For Beginners) Eleqtriq 4 3,668 10-10-2011, 01:00 PM
Last Post: Greyersting
  Could not connect: Access denied for user 'root'@'localhost' nevets04 5 4,462 02-03-2011, 04:52 PM
Last Post: Gaijin

Forum Jump:


Users browsing this thread: 3 Guest(s)