I'm a newbi in php and I want to register a nickname to the nickserv of my IRC-Serv.
I'm using an "IRC client module for PHP IRC clients" and it's working ok.
But on my register page I have got a little problem:
I want show the User only something like "Your nick is registered" or "Sorry, but this nick is already registered" and not the whole Server-Message.
The Server Message I got with a callback function:
irc_add_callback(IRCCB_ONNOTICE, "privmsg_callback");
function privmsg_callback($code, $nick, $identd, $host, $destination, $text)
{
if ($text{2} == "e") {
print "Dein Nick wurde erfolgreich registriert!";
} else {
print "Dieser Nick ist leider schon vergeben, bitte wähle einen anderen";
}
}
(the Server message begins with "The" if the nick is registered)
I thought I could use an easy "if else" but I get this output on my register page:
Dein Nick wurde erfolgreich registriert!Dein Nick wurde erfolgreich registriert!Dein Nick wurde erfolgreich registriert!Dein Nick wurde erfolgreich registriert!
It seems that the function loops or so but why? And how I can make it that the function stops after it done his job?
Please help me and excuse me for my terrible english
Thanks!