note 26764 added to ref.ircg
| From: | darkelder@php.net | Date: | Tue, 12 Nov 2002 02:56:12 +0000 |
| Subject: | note 26764 added to ref.ircg | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-39362@lists.php.net to get a copy of this message | ||
I am adding here an simple example script, without frames and without form input field:
<?PHP
/* change it to your own nickname */
$nickname = "myOwnNick";
/* choice your irc server */
$server = "irc.brasirc.net";
/* change to your channel */
$channel = "#linux";
/* do not change it if you do not know what means :-) */
$port = "6667";
/* as ircg cannot resolve hosts, we use PHP internal function to get the IP */
$ip = gethostbyname($server);
/* connection */
$id = ircg_pconnect($nickname,$ip,$port);
/* checking if connected */
if (!ircg_is_conn_alive($id))
{
print "Cannot connect<br>";
}
/* joining a channel */
if (!ircg_join($id,$channel))
{
print "Cannot join to $chanell<br>";
}
/* getting messages - you must have this in your php file */
ircg_set_current($id);
/* send messages to your channel and you */
ircg_msg($id,$channel,"Hello $channel!!");
ircg_msg($id,$channel,"This message goes to me!!!");
?>
--
http://www.php.net/manual/en/ref.ircg.php
http://master.php.net/manage/user-notes.php?action=edit+26764
http://master.php.net/manage/user-notes.php?action=delete+26764
http://master.php.net/manage/user-notes.php?action=reject+26764