File size: 1.17Kb
<?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";
$nimet=file_get_contents('paikalla.txt');
$nim=file('paikalla.txt');
$chatpaik=file('chatpaikalla.txt');
$chatpaikcont=file_get_contents('chatpaikalla.txt');
$l="0";
for ($i=0; $i<count($nim); $i++)
{
if ($nimi==rtrim($nim[$i])){$l="1";}
}
if ($l=="1"){
$nimet = str_replace ($nimi .'
',"", $nimet);
$ne= fopen('paikalla.txt', 'r+');
ftruncate ($ne,0);
fputs($ne, $nimet);
fclose($ne);
$chatpaikcont = str_replace ($nimi .'
',"", $chatpaikcont);
$ne= fopen('chatpaikalla.txt', 'r+');
ftruncate ($ne,0);
fputs($ne, $chatpaikcont);
fclose($ne);
}
echo "<wml>";
echo "<card title=\"Logout\" ontimer=\"home.php?time=".time()."\">";
echo "<timer value=\"10\"/>";
echo "<p>";
echo "You have logged out.<br/>\n";
echo "Redirecting..<br/>\n";
echo "</p>";
echo "</card>";
echo "</wml>";
?>