Hi there,
I have been battling for the last three or four days now to successfully complete this project, and I've constantly hit nothing but brick walls.
What I am trying to do is get PHP to connect to an IRC server, issue some commands, listen for the feedback, print it, and then log out again. I've been trying to use the phpirclib by Till Gerken but it doesn't seem to work. I am using PHP 3.0.9 on Apache 1.3.6.
99% of the time all I will get is a time out error (from my web proxy, not the script) complaining of a Zero Sized reply, i.e. the script just isn't generating anything. I've logged into IRC and /whois'ed the PHP script, it shows up, so it has no problem logging in as such.
For the first time ever I think, I got some debug output though. Upon submitting a nick to check if it is online, I waited about 8 seconds, then received this:
09:41:27 - O: 0 S: 0 R: 0 ||| irc_put_message(): Sending "PONG :4863FE77 "
Connection error.
From my knowledge of IRC this says that the server sent a PING, and the last thing the script did was send a PONG back. Why is the script stopping here? Has anyone used the phpirclib from PHPWizard.net? I've included the 'isonline.php3' script below just in case I'm missing something blindingly obvious.
// Include the IRC layer
include("phpIRC.php3");
include("phpIRC.inc.php3");
$wanted_server = "fusion-uk.chat-solutions.net";
$wanted_port = 6667;
//$wanted_nick = uniqid("a");
//$wanted_nick = substr($wanted_nick, 0, 8);
if(!irc_init())
die("Initialization error.<br>");
irc_set_debug_mode(1);
irc_change_nick("India");
if(!irc_connect($wanted_server, $wanted_port))
die("Connection error.<br>");
if(!irc_whois($nick))
print("$nick is not online.<br>");
else
print("$nick is online!<br>");
irc_disconnect("");
}
If anyone can offer help or suggestions, or perhaps even knows of a simpler way to do this, I would be most appreciative.