Results 1 to 3 of 3

Thread: php and irc

  1. #1
    Blast From the Past
    Join Date
    Jan 2003
    Posts
    729

    php and irc

    hello all

    i have a small irc server that im currently testing... going to use it for my friends in town
    i already found a perl client that i have installed on my website... cgiirc and it works great... but im trying to figure out if i can make or find a php script that can show if i have users in my chatroom and if the server is even running

    i tried searching google but i cant find anything that can teach me how to creat a simple one

    i would like to learn how to use php.. not just copy and paste some code and call it quits

    if anyone can point me in the right direction that would be great

    untill then il still be browsing around google to see what i can find


    thanks all
    work it harder, make it better, do it faster, makes us stronger

  2. #2
    Senior Member
    Join Date
    Mar 2004
    Posts
    557
    Hi

    I understand you would like to gain experience on both php and irc, by
    making your own irc-"library" in php, e.g. by writing a bot - which actually
    can be quite funny

    IRCP[1] talks over TCP/IP, hence it is natural to use the fsockopen()[2]-command
    to initiate a connection to your IRC server. The handle can be used as any other
    file handle ie. send with fputs and receive with fgets. Terminate the connection with
    fclose.

    I recommend you this nice little tutorial[3], which will get you started. Once you
    have the idea, you "simply" need to implement the parts of the IRCP RFC you are
    interested in. To answer the two of your questions: the server is running if you
    can connect to it , you obtain the nickname-list by using NAMES, as specified in
    4.2.5.

    Good luck.

    Cheers.


    [1] http://www.ietf.org/rfc/rfc1459.txt?number=1459
    [2] http://www.phpbuilder.com/manual/function.fsockopen.php
    [3] http://www.codedemons.net/tutorials/...wn-IRC-Bot?p=1
    If the only tool you have is a hammer, you tend to see every problem as a nail.
    (Abraham Maslow, Psychologist, 1908-70)

  3. #3
    Blast From the Past
    Join Date
    Jan 2003
    Posts
    729
    exactly what i was looking for!!
    thanks so much sec_ware
    work it harder, make it better, do it faster, makes us stronger

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •