Codice PHP:
$nimi = $_REQUEST['nimi'];
$salasana = $_REQUEST['salasana'];
$aikanyt=time();
$aika=file('../text/ajat.txt');
$ero=$aikanyt-$aika[0];
if ($ero>=3600){
$peke = fopen('../text/paikalla.txt', 'r+');
ftruncate ($peke,0);
fclose($peke);
}
$nimi= htmlspecialchars($nimi);
$hostsnames=gethostbyaddr($REMOTE_ADDR);
$iplog = "::$nimi $REMOTE_ADDR $HTTP_USER_AGENT:: ";
$fp=@fopen("../text/iplog.txt","a");
@fputs($fp,"$iplog \r\n");
@fclose($fp);
$swe_from = array("","","","","","","$","&");
$swe_to = array("", "", "", "", "", "","[usd]","[and]");
for ($t=0; $t<count($swe_from); $t++)
{
$nimi = str_replace ($swe_from[$t], $swe_to[$t], $nimi);
$salasana = str_replace ($swe_from[$t], $swe_to[$t], $salasana);
}
$salasana=crypt($salasana,'password');
$salsan=file('../text/sals.txt');
$salnim=file('../text/nims.txt');
for ($k=0; $k<count($salnim); $k++)
{ if (rtrim($salsan[$k])==$salasana && rtrim($salnim[$k])==$nimi){$b="1";}}
$paikalla=file('../text/paikalla.txt');
for ($u=0; $u<count($paikalla); $u++)
{
if (rtrim($paikalla[$u])==$nimi)
{$sama="1";$u=count($paikalla)+1;}
}
$New_Time = time() + (0 * 60 * 60);
$time=date("H:i",$New_Time);
$user = explode ('/',$_SERVER['HTTP_USER_AGENT']);
$ip = $_SERVER['$REMOTE_ADDR'];
echo "<wml>";
if ($b == "1"){
$tiednim= fopen('../text/kirjaus.txt', 'r+');
$k3=file_get_contents ('../text/kirjaus.txt');
$lisnim=date('y.m.d.H:i:s') .' HOSTNAME: '.$hostsnames. ' REMOTE_ADDR:'.$REMOTE_ADDR . ' HTTP_USER_AGENT:'.$HTTP_USER_AGENT;
$lisnim=$lisnim.'
'.$k3;
fputs($tiednim, $lisnim);
fclose($tiednim);
if ($nimi != "hiddenname" && $sama != "1") {
$tie = fopen('../text/paikalla.txt', 'r+');
$ko=file_get_contents ('../text/paikalla.txt');
$to=$nimi .'
'. $ko;
fputs($tie, $to);
fclose($tie);
}
echo "<card title=\"Login..\">";
echo "<p align=\"center\">";
include("../tools/admin.php");
if($admin=="1"){$tie = fopen('../text/mano.txt', 'r+');
$ko=file_get_contents ('../text/mano.txt');
$to='<small><b><a href="pmuser.php?kenelle='.$nimi.'&nimi=$nimi&salasana=$salasana&rank=1&phone='.$user[0].'&ip='.$ip.'">*</a></b>©'.$nimi.' entra alle: '.$time.'</small><br/>
'. $ko;
fputs($tie, $to);
fclose($tie);}
if($admin=="2"){$tie = fopen('../text/mano.txt', 'r+');
$ko=file_get_contents ('../text/mano.txt');
$to='<small><b><a href="pmuser.php?kenelle='.$nimi.'&nimi=$nimi&salasana=$salasana&rank=2&phone='.$user[0].'&ip='.$ip.'">*</a></b>¹'.$nimi.' entra alle: '.$time.'</small><br/>
'. $ko;
fputs($tie, $to);
fclose($tie);}
if($admin=="3"){$tie = fopen('../text/mano.txt', 'r+');
$ko=file_get_contents ('../text/mano.txt');
$to='<small><b><a href="pmuser.php?kenelle='.$nimi.'&nimi=$nimi&salasana=$salasana&rank=3&phone='.$user[0].'&ip='.$ip.'">*</a></b>²'.$nimi.' entra alle: '.$time.'</small><br/>
'. $ko;
fputs($tie, $to);
fclose($tie);}
if($admin=="4"){$tie = fopen('../text/mano.txt', 'r+');
$ko=file_get_contents ('../text/mano.txt');
$to='<small><b><a href="pmuser.php?kenelle='.$nimi.'&nimi=$nimi&salasana=$salasana&rank=4&phone='.$user[0].'&ip='.$ip.'">*</a></b>'.$nimi.' entra alle: Blah</small><br/>
'. $ko;
fputs($tie, $to);
fclose($tie);}
if($admin=="7"){$tie = fopen('../text/mano.txt', 'r+');
$ko=file_get_contents ('../text/mano.txt');
$to='<small><b><a href="pmuser.php?kenelle='.$nimi.'&nimi=$nimi&salasana=$salasana&rank=7&phone='.$user[0].'&ip='.$ip.'">*</a></b>'.$nimi.' entra alle: Trashed</small><br/>
'. $ko;
fputs($tie, $to);
fclose($tie);}
if($admin=="0"){$tie = fopen('../text/mano.txt', 'r+');
$ko=file_get_contents ('../text/mano.txt');
$to='<small><b><a href="pmuser.php?kenelle='.$nimi.'&nimi=$nimi&salasana=$salasana&rank=0&phone='.$user[0].'&ip='.$ip.'">*</a></b>'.$nimi.' entra alle: '.$time.'</small><br/>
'. $ko;
fputs($tie, $to);
fclose($tie);}
if($admin=="1"){ echo "<small>your rank:<br/> <b>owner</b></small><br/>---<br/>"; }
if($admin=="2"){ echo "<small>your rank:<br/> <b>administrator</b></small><br/>---<br/>"; }
if($admin=="3"){ echo "<small>your rank:<br/> <b>moderator</b></small><br/>---<br/>"; }
if($admin=="4"){ echo "<small>your rank:<br/> <b>blahd</b></small><br/>---<br/>"; }
if($admin=="7"){ echo "<small>your rank:<br/> <b>trashed</b></small><br/>---<br/>"; }
if($admin=="0"){ echo "<small>your rank:<br/> <b>chatter</b></small><br/>---<br/>"; }
$xfile = @file("../text/randomlogin.txt");
$random_num = rand (0,count($xfile)-1);
$udata = explode("::",$xfile[$random_num]);
echo $udata[1];
echo "<small><anchor>»Continue";
echo "<go method=\"post\" href=\"../room1/chat.php\">";
echo "<postfield name=\"ines\" value=\"$(ines)\"/>";
echo "<postfield name=\"nimi\" value=\"$(nimi)\"/>";
echo "<postfield name=\"salasana\" value=\"$(salasana)\"/>";
echo "</go>";
echo "</anchor></small><br/>";
}
if ($b != "1"){
echo "<card title=\"Logging in\" >";
echo "<p align=\"center\">";
echo "<small>**!!ATTENTION!!** We had a problem with the server and had to reset the database! Please REGISTER AGAIN! Register ONLY ONCE! Anyone we find using multiple nicknames WILL BE BANNED! Sorry for any inconvenience. Thanks :-)</small>";
echo "<br/>---<br/>";
$xfile = @file("../text/randomloginerror.txt");
$random_num = rand (0,count($xfile)-1);
$udata = explode("::",$xfile[$random_num]);
echo $udata[1];
echo "<small><a href=\"sisaan.php\">«Indietro</a></small><br/>";
}