File size: 2.19Kb
<?php
//=====заголовок каждой страницы и конвертация русского в unicode=====
header("Content-type:text/vnd.wap.wml");
echo "<?xml version=\"1.0\" ?>\n";?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<head>
<meta forua="true" http-equiv="Cache-Control" content="must-revalidate"/>
<meta forua="true" http-equiv="Cache-Control" content="no-cache"/>
<meta forua="true" http-equiv="Cache-Control" content="no-store"/>
</head>
<card id="start" title="Login">
<p>
Login: <br/>
<input title="login" name="login" value=""/><br/>
password<br/>
<input type="password" title="pass" name="password" maxlength="20"/>
<br/>
<do>
<go href="index.php?ent=enter" method="post">go
<postfield name="login" value="$(login)"/>
<postfield name="password" value="$(password)"/>
</go>
</do></p>
<p>
<a href="register.wml">Registration</a>| <a href="http://c100fun.da.ru">Home</a></p>
<p>Counter:<br/> <?PHP
$filename = "counter.dat";
$fp = @fopen($filename,"r");
if ($fp) {
$counter=fgets($fp,10);
fclose($fp);
} else {
$counter=0;
}
$counter++;
print $counter;
$fp = fopen($filename,"w");
if ($fp) {
$counter=fputs($fp,$counter);
fclose($fp);
}
?>
</p></card>
<?
for ($ent = enter ) {
print "<card title=\"Enter\">\n";
if ($login == "" and $password == "") { print"<p>Zapolnite polya!</p>";}
if ($login == "$udata[0]" and $password == "$udata[1]") { print"<p>
Hello, $login !<br/>
Choose:
<br/>
<a href=\"register.wml\">Register</a>
<br/>
<a href=\"logout.php\">logout</a>
</p>";}
//wrong username and password
else {
echo "<p>Неверный логин или пароль!</p>";
}
}
print"</card></wml>";
?>