wiggly81 Posted October 21, 2012 Share Posted October 21, 2012 I am trying to create a webpage that allows users to register on my IRC network.... i seem to get a connection but after that it does not seem to work, any help or advice would be gratefully received Thanx <html> <head> <title>Chat Register</title> </head> <body bgcolor="#C0C0C0"> <?PHP if(isset($_POST['submit'])) { $server = "127.0.0.1"; $port = "6667"; $nick = $_POST['nick']; $pass = $_POST['pass']; $email = $_POST['email']; $open = fsockopen($server, $port, $errno, $errstr, 30); if($open) { //we are connected... print "Connected!<br /><br />"; //This Is Displayed..... fwrite($open, "NICK ". $nick); fwrite($open, "USER WebRegistration"); fwrite($open, "NICKSERV REGISTER ". $pass ." ". $email); }else { //Woooops... print "Error!<br />"; print $errstr ($errno) ."<br />\n"; } fclose($open); }else { ?> <form name="register" action="#" method="post"> <table width="100%" height="100%" align="center" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="100%" height="100%" align="center" valign="middle"> <table width="25%" align="center" border="0" cellpadding="0" cellspacing="0"> <tr> <td colspan="3" align="center"><h1>Chat Register</h1></td> </tr> <tr> <td width="49%" align="right">Chat Name</td> <td width="2%" align="center"> </td> <td width="49%" align="left"><input type="text" name="nick" value="" /></td> </tr> <tr> <td width="49%" align="right">Password</td> <td width="2%" align="center"> </td> <td width="49%" align="left"><input type="password" name="pass" value="" /></td> </tr> <tr> <td width="49%" align="right">Email</td> <td width="2%" align="center"> </td> <td width="49%" align="left"><input type="text" name="email" value="" /></td> </tr> <tr> <td colspan="3" align="center"> </td> </tr> <tr> <td colspan="3" align="right"><input type="submit" name="submit" value="Register" /></td> </tr> </table> </td> </tr> </table> </form> <?PHP } ?> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/269738-php-irc-send-data/ Share on other sites More sharing options...
requinix Posted October 21, 2012 Share Posted October 21, 2012 If you're going to write something that deals with an IRC server yourself then you must learn the protocol. Blathering on about "user" and "nickserv" won't do you any good unless you can talk to the server in a way that it understands. I can't remember what I used as a reference back when I wrote a bot, but there's this for starters. At least you're close, though. Thankfully IRC communication is text-based. Quote Link to comment https://forums.phpfreaks.com/topic/269738-php-irc-send-data/#findComment-1386756 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.