# PHP-IRC-Client



## Burge (18. April 2006)

Moinsen,

also ich denke ich habe die Suche gut bemüht aber sorry ich finde einfach nichts 
über eine IRC Client der auf PHP Basis läuft. Gedanke bzw Notwendigkeit dahinter ist, das er
in Umgebungen laufen muss wo Java etc. nicht erlaubt ist.

Wenn jemand eine Idee hat wäre ich sehr dankbar.


----------



## fUnKuCh3n (19. April 2006)

hi,

ich hab gerad was gefunden hab ich vor langer zeit ma gecodet 


```
<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); 
} 
} 
} 

?>
```

musste evtl anpassen aber soweit  tut er noch gerad getestet!

Lg Sascha


----------

