All pastes #555053 Raw Edit

Someone

public text v1 · immutable
·published 2007-06-10 10:51 UTC
rendered paste body
<?
$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);

?>