Menu

Send text from form as message?

Help
2003-10-10
2013-04-09
  • Nobody/Anonymous

    Hi there,

    is there any possibility to send some text as a message to the IRC channel which comes directly from a form? I am talking about manually and casually inserted text and not about certain text for certain events what most of the bots use...

    Thank you very much,
    Florian

     
    • Mirco Bauer

      Mirco Bauer - 2003-10-14

      it's easy, make an HTML form, send the form to an smartirc script, which connects to IRC, send the text and disconnects from IRC, no events etc needed...

       
    • Nobody/Anonymous

      I'm trying to do something like that but I can't figure out what arguments should I use with the "$irc->message()" method to send the messages to the channel.

      Thanks.

       
    • Tim Ballantine

      Tim Ballantine - 2004-02-29

      Normally, you can use a $_POST['text'] variable (superglobal) or $HTTP_POST_VARS['text'].

      Just:
      $message = $_POST['text'];
      $channel = $_POST['channel'];
      $irc->message(SMARTIRC_TYPE_CHANNEL, $channel, $message);

       
    • Nobody/Anonymous

      and how to disconnect after this?

       

Log in to post a comment.