View file mobilechat_v1.04/logout.php

File size: 0.98Kb
<?php
ignore_user_abort (TRUE);
header("Content-type: text/vnd.wap.wml");
echo "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"
\"http://www.wapforum.org/DTD/wml_1.1.xml\">";
$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\">";
echo "<timer value=\"10\"/>";
echo "<p>";
echo "You have logged out.<br/>";
echo "</p>";
echo "</card>";
echo "</wml>";
?>