Размер файла: 2.52Kb
<?php
header("Content-type: text/html; charset=ISO-8859-1");
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n";
echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\"
\"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">\n";
echo "<!-- MobiiliChat v1.11color -->\n";
echo "<!-- Copyright (C) 2004-2005 Keijo Kangas ([email protected]) -->\n";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
echo "<head>\n";
echo "<title>Kirjautuminen</title>\n";
echo "</head>\n";
echo "<body bgcolor=\"#99CCFF\" link=\"#0000CC\" vlink=\"#0000CC\" alink=\"#0000CC\">";
$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);
}
$teoria=$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='in:<b>'.$nimi.'</b><br/>
'. $ko;
fputs($tie, $to);
fclose($tie);
}
echo "Olet kirjautunut sisддn.<br>\n";
echo "<a href=\"chat_fi.php?time=".date('dmHis').'&nimi='.$nimi.'&salasana='.$teoria."\">[Jatka]</a>\n";
}
if ($b != "1"){
echo "Nimi tai salasana kirjoitettu vддrin tai jostain syystд tunnuksellasi ei ole enдд oikeuksia.<br/>";
echo "<a href=\"sisaan_fi.php\">[Takaisin]</a>";
}
echo "</body>";
echo "</html>";
?>