Просмотр файла magmail/index.php

Размер файла: 3.04Kb
<?
$change=array(
  "а" => "&#x0430;",
  "б" => "&#x0431;",
  "в" => "&#x0432;",                                                         
  "г" => "&#x0433;",
  "д" => "&#x0434;",
  "е" => "&#x0435;",
  "ё" => "&#x0451;",
  "ж" => "&#x0436;",
  "з" => "&#x0437;",
  "и" => "&#x0438;",
  "й" => "&#x0439;",
  "к" => "&#x043A;",
  "л" => "&#x043B;",
  "м" => "&#x043C;",                                                         
  "н" => "&#x043D;",
  "о" => "&#x043E;",
  "п" => "&#x043F;",
  "р" => "&#x0440;",
  "с" => "&#x0441;",
  "т" => "&#x0442;",
  "у" => "&#x0443;",
  "ф" => "&#x0444;",
  "х" => "&#x0445;",
  "ц" => "&#x0446;",
  "ч" => "&#x0447;",                                                         
  "ш" => "&#x0448;",
  "щ" => "&#x0449;",
  "ъ" => "&#x044A;",
  "ы" => "&#x044B;",
  "ь" => "&#x044C;",
  "э" => "&#x044D;",
  "ю" => "&#x044E;",
  "я" => "&#x044F;", 
  "А" => "&#x0410;",
  "Б" => "&#x0411;",
  "В" => "&#x0412;",                                                         
  "Г" => "&#x0413;",
  "Д" => "&#x0414;",
  "Е" => "&#x0415;",
  "Ё" => "&#x0401;",
  "Ж" => "&#x0416;",
  "З" => "&#x0417;",
  "И" => "&#x0418;",
  "Й" => "&#x0419;",
  "К" => "&#x041A;",
  "Л" => "&#x041B;",
  "М" => "&#x041C;",                                                         
  "Н" => "&#x041D;",
  "О" => "&#x041E;",
  "П" => "&#x041F;",
  "Р" => "&#x0420;",
  "С" => "&#x0421;",
  "Т" => "&#x0422;",
  "У" => "&#x0423;",
  "Ф" => "&#x0424;",
  "Х" => "&#x0425;",
  "Ц" => "&#x0426;",
  "Ч" => "&#x0427;",                                                         
  "Ш" => "&#x0428;",
  "Щ" => "&#x0429;",
  "Ъ" => "&#x042A;",
  "Ы" => "&#x042B;",
  "Ь" => "&#x042C;",
  "Э" => "&#x042D;",
  "Ю" => "&#x042E;",
  "Я" => "&#x042F;",
);



function win2utf($s)
{
global $change;
  $s = str_replace("\r\n","",$s);
  $s = preg_replace("/[\x01-\x1F\x80-\xA7\xA9-\xB7\xB9-\xBF]/s","?",$s);
  return strtr($s,$change);
}
 

function ShowMess($title,$mess,$linkmess,$link,$wait)
{  
  Header("Content-type:text/vnd.wap.wml; charset=UTF-8\n\n\n");
  echo "<?xml version=\"1.0\"?>";
  echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">\n";
  echo "<wml>";
  echo "<card title=\"".win2utf($title)."\">";
  echo "<onevent type=\"ontimer\">\n";
  if ($link == "") {echo "<prev/>\n"; $link="prev/"; }
  else { echo "<go href=\"$link\"/>"; $link="go href=\"$link\"/";}
  echo "</onevent>";	
  echo "<timer value=\"$wait\"/>";
  echo "<p align=\"center\">";
  if ($mess != "") echo win2utf($mess)."<br/>\n"; 
  if ($linkmess != "")  echo "<anchor>".win2utf($linkmess),"<$link></anchor>\n";
  echo "</p>";
  echo "</card>";
  echo "</wml>";
  exit();
}

if (strpos(" ".strtolower($HTTP_HOST),"mag.su") === false)
ShowMess("- Маг -","","Поздравляем Вас с переездом на новый сервер. Измените в закладках wap.computermag.ru на mag.su","http://mag.su/magmail",20);
else ShowMess("- Маг -","","Технический вход на новый сервер","http://ssp.p8.ru/magmail",20);
?>