Размер файла: 1.56Kb
<?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.1 -->\n";
echo "<!-- Copyright (C) 2004-2005 Keijo Kangas ([email protected]) -->\n";
echo "<wml>";
echo "<card title=\"Creating account..\">";
echo "<p>";
$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);
}
$nimi = strtolower($nimi);
$salasana = strtolower($salasana);
$salsan=file('sals.txt');
$salnim=file('nims.txt');
$salasanapieni=$salasana;
for ($u=0; $u<count($salnim); $u++)
{ if (rtrim($salnim[$u])==$nimi){$nimi='';}}
if ($salasana !='' && $nimi !='') {
$tiedsal = fopen('sals.txt', 'a');
$salasana = crypt($salasana,'password');
$lissal=$salasana.'
';
fputs($tiedsal, $lissal);
fclose($tiedsal);
$tiednim= fopen('nims.txt', 'a');
$lisnim=$nimi.'
';
fputs($tiednim, $lisnim);
fclose($tiednim);}
if ($nimi !='') {echo "Ok.<br/>";
echo "Nick:".$nimi."<br/>";
echo "Password:".$salasanapieni."<br/>";
echo "<a href=\"home.php\">[Home]</a>";}
if ($nimi =='') {echo "Nick is in use.<br/>Use another nick.<br/>";
echo "<a href=\"luonti.wml\">[Back]</a>";}
echo "</p>";
echo "</card>";
echo "</wml>";
?>