Someone
public text v1 · immutable<?
$defnamefile = "Defname.txt";
$nick = $_GET['nick'];
$host = $_GET['host'];
$temp = file("$defnamefile");
$readfile = fopen($defnamefile,'w');
foreach ($temp as $tmp) {
if (stristr($tmp,"$host")) {
$str = $tmp;
}
$tmmp .= "$tmp";
}
if ($str) {
$tmp = str_replace($str,"$host $nick",$tmmp);
}
else {
$tmp .= "\n$host $nick";
}
fwrite($readfile,"$tmp");
fclose($readfile);
?>