Jump to content

Php Irc Send Data


wiggly81

Recommended Posts

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>

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.