File size: 1.5Kb
<?
function unicode ($s) {
if ( (ord($s)>=192) & (ord($s)<=255) ) $hexvalue=dechex(ord($s)+848);
if ($s=="Ё") $hexvalue="401";
if ($s=="ё") $hexvalue="451";
return("�".$hexvalue.";");
}
function utf_encode ($s) {
return(preg_replace("/[А-яЁё]/e","unicode('\\0')",$s));
}
header("Content-type:text/vnd.wap.wml;charset=UTF-8");
print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">
<wml>
<card id=\"tes\" title=\"ICQ\">";
if($go=="icq")
{
print utf_encode("
<p>
Введите ICQ uin.<br/>
<input title=\"uin\" name=\"uin\"/><br/>
<anchor title=\"Ok\">OK<br/>
<go href=\"wapicq.php?go=add\" method=\"post\">
<postfield name=\"uin\" value=\"$(uin)\"/>
</go>
</anchor>
</p>
");
}
if($go=="add")
{
print utf_encode("<p>Статус <img src=\"http://web.icq.com/whitepages/online?icq=$uin&img=5\"/><br/>
Ваше Имя.
<input type=\"text\" name=\"name\" maxlength=\"256\"/><br/>
ICQ UIN:
<input type=\"text\" name=\"icq\" value=\"$uin\" maxlength=\"256\"/><br/>
Сообщение:
<input type=\"text\" name=\"message\"/><br/>
<anchor title=\"send\">GO
<go href=\"send.php\" accept-charset=\"UTF-8\" method=\"post\">
<postfield name=\"name\" value=\"$(name)\"/>
<postfield name=\"icq\" value=\"$(icq)\"/>
<postfield name=\"message\" value=\"$(message)\"/>
<postfield name=\"go\" value=\"go\"/>
</go>
</anchor>
</p>
");
}
print "
</card>
</wml>";
?>