Просмотр файла wap.rzz.ru/chat/login.php

Размер файла: 2.52Kb
<?php
header("Content-type: text/vnd.wap.wml; charset=ISO-8859-1");
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"
\"http://www.wapforum.org/DTD/wml_1.1.xml\">\n";
echo "<!-- MobiiliChat v1.07 -->\n";
echo "<!-- Copyright (C) 2004-2005 Keijo Kangas ([email protected]) -->\n";
$aikanyt=time();
$aika=file('ajat.txt');
$ero=$aikanyt-$aika[0];
if ($ero>=3600){
$peke = fopen('paikalla.txt', 'r+');
 ftruncate ($peke,0);
 fclose($peke);
}

$nimi= htmlspecialchars($nimi); 
$hostsnames=gethostbyaddr($REMOTE_ADDR);

 $swe_from = array("ГҐ","Г¤","Г¶","Г…","Г„","Г–","$","&"); 
$swe_to = array("е", "д", "ц", "Е", "Д", "Ц","d","j"); 

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('sals.txt');
$salnim=file('nims.txt');
for ($k=0; $k<count($salnim); $k++) 
{ if (rtrim($salsan[$k])==$salasana && rtrim($salnim[$k])==$nimi){$b="1";}}

$paikalla=file('paikalla.txt');
for ($u=0; $u<count($paikalla); $u++) 
{
 if (rtrim($paikalla[$u])==$nimi)
 {$sama="1";$u=count($paikalla)+1;}
}


echo "<wml>";
if ($b == "1"){
$tiednim= fopen('kirjaus.txt', 'r+');
$k3=file_get_contents ('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 != "admin" && $sama != "1") {
 $tie = fopen('paikalla.txt', 'r+');
  $ko=file_get_contents ('paikalla.txt');
  $to=$nimi .'
'. $ko;
  fputs($tie, $to);
  fclose($tie);

 $tie = fopen('chat.txt', 'r+');
  $ko=file_get_contents ('chat.txt');
  $to='('.date('H:i').')in:<b>'.$nimi.'</b><br/>
'. $ko;
  fputs($tie, $to);
  fclose($tie);

}
echo "<card title=\"Login..\">";
echo "<p>";
echo "You have logged in.";
echo "<br/><anchor>[Continue]";
echo "<go method=\"post\" href=\"chat.php\">";
echo "<postfield name=\"ines\" value=\"$(ines)\"/>";
echo "<postfield name=\"nimi\" value=\"$(nimi)\"/>";
echo "<postfield name=\"salasana\" value=\"$(salasana)\"/>";
echo "</go>";
echo "</anchor><br/>";
}

if ($b != "1"){
echo "<card title=\"Logging in\" >";
echo "<p>";
echo "Nick or password typed incorrectly or your account has been disabled for some reason.<br/>";
echo "<a href=\"sisaan.php\">[Back]</a>";
}

echo "</p>";
echo "</card>";
echo "</wml>";
?>