<form action="<? echo $PHP_SELF; ?>" method="post">
Server:<input type="text" name="server"><br>
Port:<input type="text" name="Port"> <br>
Nick:<input type="text" name="nick3"> <br>
Name:<input type"text" name="realna"> <br>
Owner:<input type"text" name="owner"> <br>
<input type="submit" name="submit" value="Adden">
</form>
<?
if(isset($_POST["submit"])){
$server = $_POST["server"];
$nick3 = $_POST["nick3"];
$realna = $_POST["realna"];
$owner = $_POST["owner"];
$port = $_POST["port"];
}
if (!$nick2)
{
$nick2 = "b4sh0r_afk";
}
$connect = fsockopen($server, $port);
echo "<title>".$nick2."</title>";
fputs($connect, "USER $nick3 0 0 :$realna\n\r");
fputs($connect, "NICK $nick2\n\r");
echo "Running ";
while(!feof($connect))
{
$new = fgets($connect, 1024);
$part = explode(" ",$new);
if($part[0] == "PING")
{
$ping = explode(":", $new);
$reply = $ping[1];
fputs($connect, "PONG $reply\n\r");
if (!$firstrun) {
fputs($connect, "JOIN #channel \n\r");
$firstrun = "1";
}
}
if(substr($part[2],0,1) != "#" && $nick == $owner) {
if(substr($part[3],0,2) == ":!")
{
$part_count = count($part)-1;
$i = "3";
$part[3] = substr($part[3],2);
while($i <= $part_count)
{
$cmd.=$part[$i]." ";
$i++;
}
fputs($connect, "$cmd\n\r");
unset($cmd);
}
}
elseif(substr($part[2],0,1) == "#")
{
$nick = explode("!",$part[0]);
$nick = substr($nick[0],1);
if(substr($part[3],0,5) == ":!hop" && $nick == $owner)
{
fputs($connect, "part $part[4] rejoining. \n\r");
fputs($connect, "join $part[4] \n\r");
}
elseif(substr($part[3],0,2) == ":!" && $nick == $owner)
{
$part_count = count($part)-1;
$i = "3";
$part[3] = substr($part[3],2);
while($i <= $part_count)
{
$cmd.=$part[$i]." ";
$i++;
}
fputs($connect, "$cmd\n\r");
unset($cmd);
}
}
}
?>