Просмотр файла transcode2/trans.php

Размер файла: 6.48Kb
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" " http://www.w3.org/TR/html4/loose.dtd"> 
<html> 
 <head> 
 <meta http-equiv="Content-Type" content="text/html;
   charset=windows-1251">
  <title>TRANSFER v2.3</title>
  </head>

  <body text="lime" link="red" bgcolor="black">
  <div align='center'> 
<? $name=str_replace("../","",$name);
if((!$name) || (empty($name)))
{ echo "<h2>Введете имя файла!!!</h2>"; }
else { 
echo '<h1>Последним был создан файл:</h1><h2> ';
echo $name;
echo '</h2>';
 if ($sel=='a') {
 $a1=str_replace("А","&#x410;",$a);
 $a1=str_replace("Б","&#x411;",$a1);
 $a1=str_replace("В","&#x412;",$a1);
 $a1=str_replace("Г","&#x413;",$a1);
 $a1=str_replace("Д","&#x414;",$a1);
 $a1=str_replace("Е","&#x415;",$a1);
 $a1=str_replace("Ё","&#x401;",$a1);
 $a1=str_replace("Ж","&#x416;",$a1);
 $a1=str_replace("З","&#x417;",$a1);
 $a1=str_replace("И","&#x418;",$a1);
 $a1=str_replace("Й","&#x419;",$a1);
 $a1=str_replace("К","&#x41A;",$a1);
 $a1=str_replace("Л","&#x41B;",$a1);
 $a1=str_replace("М","&#x41C;",$a1);
 $a1=str_replace("Н","&#x41D;",$a1);
 $a1=str_replace("О","&#x41E;",$a1);
 $a1=str_replace("П","&#x41F;",$a1);
 $a1=str_replace("Р","&#x420;",$a1);
 $a1=str_replace("С","&#x421;",$a1);
 $a1=str_replace("Т","&#x422;",$a1);
 $a1=str_replace("У","&#x423;",$a1);
 $a1=str_replace("Ф","&#x424;",$a1);
 $a1=str_replace("Х","&#x425;",$a1);
 $a1=str_replace("Ц","&#x426;",$a1);
 $a1=str_replace("Ч","&#x427;",$a1);
 $a1=str_replace("Ш","&#x428;",$a1);
 $a1=str_replace("Щ","&#x429;",$a1);
 $a1=str_replace("Ъ","&#x42A;",$a1);
 $a1=str_replace("Ы","&#x42B;",$a1);
 $a1=str_replace("Ь","&#x42C;",$a1);
 $a1=str_replace("Э","&#x42D;",$a1);
 $a1=str_replace("Ю","&#x42E;",$a1);
 $a1=str_replace("Я","&#x42F;",$a1);
 $a1=str_replace("а","&#x430;",$a1);
 $a1=str_replace("б","&#x431;",$a1);
 $a1=str_replace("в","&#x432;",$a1);
 $a1=str_replace("г","&#x433;",$a1);
 $a1=str_replace("д","&#x434;",$a1);
 $a1=str_replace("е","&#x435;",$a1);
 $a1=str_replace("ё","&#x451;",$a1);
 $a1=str_replace("ж","&#x436;",$a1);
 $a1=str_replace("з","&#x437;",$a1);
 $a1=str_replace("и","&#x438;",$a1);
 $a1=str_replace("й","&#x439;",$a1);
 $a1=str_replace("к","&#x43A;",$a1);
 $a1=str_replace("л","&#x43B;",$a1);
 $a1=str_replace("м","&#x43C;",$a1);
 $a1=str_replace("н","&#x43D;",$a1);
 $a1=str_replace("о","&#x43E;",$a1);
 $a1=str_replace("п","&#x43F;",$a1);
 $a1=str_replace("р","&#x440;",$a1);
 $a1=str_replace("с","&#x441;",$a1);
 $a1=str_replace("т","&#x442;",$a1);
 $a1=str_replace("у","&#x443;",$a1);
 $a1=str_replace("ф","&#x444;",$a1);
 $a1=str_replace("х","&#x445;",$a1);
 $a1=str_replace("ц","&#x446;",$a1);
 $a1=str_replace("ч","&#x447;",$a1);
 $a1=str_replace("ш","&#x448;",$a1);
 $a1=str_replace("щ","&#x449;",$a1);
 $a1=str_replace("ъ","&#x44A;",$a1);
 $a1=str_replace("ы","&#x44B;",$a1);
 $a1=str_replace("ь","&#x44C;",$a1);
 $a1=str_replace("э","&#x44D;",$a1);
 $a1=str_replace("ю","&#x44E;",$a1);
 $a1=str_replace("я","&#x44F;",$a1);
 $a2=str_replace("&","&amp;",$a1);
$file=fopen("file/$name","w"); fputs($file, $a1); fclose($file); }
 
else {
 $a1=str_replace("&#x410;","А",$a);
 $a1=str_replace("&#x411;","Б",$a1);
 $a1=str_replace("&#x412;","В",$a1);
 $a1=str_replace("&#x413;","Г",$a1);
 $a1=str_replace("&#x414;","Д",$a1);
 $a1=str_replace("&#x415;","Е",$a1);
 $a1=str_replace("&#x401;","Ё",$a1);
 $a1=str_replace("&#x416;","Ж",$a1);
 $a1=str_replace("&#x417;","З",$a1);
 $a1=str_replace("&#x418;","И",$a1);
 $a1=str_replace("&#x419;","Й",$a1);
 $a1=str_replace("&#x41A;","К",$a1);
 $a1=str_replace("&#x41B;","Л",$a1);
 $a1=str_replace("&#x41C;","М",$a1);
 $a1=str_replace("&#x41D;","Н",$a1);
 $a1=str_replace("&#x41E;","О",$a1);
 $a1=str_replace("&#x41F;","П",$a1);
 $a1=str_replace("&#x420;","Р",$a1);
 $a1=str_replace("&#x421;","С",$a1);
 $a1=str_replace("&#x422;","Т",$a1);
 $a1=str_replace("&#x423;","У",$a1);
 $a1=str_replace("&#x424;","Ф",$a1);
 $a1=str_replace("&#x425;","Х",$a1);
 $a1=str_replace("&#x426;","Ц",$a1);
 $a1=str_replace("&#x427;","Ч",$a1);
 $a1=str_replace("&#x428;","Ш",$a1);
 $a1=str_replace("&#x429;","Щ",$a1);
 $a1=str_replace("&#x42A;","Ъ",$a1);
 $a1=str_replace("&#x42B;","Ы",$a1);
 $a1=str_replace("&#x42C;","Ь",$a1);
 $a1=str_replace("&#x42D;","Э",$a1);
 $a1=str_replace("&#x42E;","Ю",$a1);
 $a1=str_replace("&#x42F;","Я",$a1);
 $a1=str_replace("&#x430;","а",$a1);
 $a1=str_replace("&#x431;","б",$a1);
 $a1=str_replace("&#x432;","в",$a1);
 $a1=str_replace("&#x433;","г",$a1);
 $a1=str_replace("&#x434;","д",$a1);
 $a1=str_replace("&#x435;","е",$a1);
 $a1=str_replace("&#x451;","ё",$a1);
 $a1=str_replace("&#x436;","ж",$a1);
 $a1=str_replace("&#x437;","з",$a1);
 $a1=str_replace("&#x438;","и",$a1);
 $a1=str_replace("&#x439;","й",$a1);
 $a1=str_replace("&#x43A;","к",$a1);
 $a1=str_replace("&#x43B;","л",$a1);
 $a1=str_replace("&#x43C;","м",$a1);
 $a1=str_replace("&#x43D;","н",$a1);
 $a1=str_replace("&#x43E;","о",$a1);
 $a1=str_replace("&#x43F;","п",$a1);
 $a1=str_replace("&#x440;","р",$a1);
 $a1=str_replace("&#x441;","с",$a1);
 $a1=str_replace("&#x442;","т",$a1);
 $a1=str_replace("&#x443;","у",$a1);
 $a1=str_replace("&#x444;","ф",$a1);
 $a1=str_replace("&#x445;","х",$a1);
 $a1=str_replace("&#x446;","ц",$a1);
 $a1=str_replace("&#x447;","ч",$a1);
 $a1=str_replace("&#x448;","ш",$a1);
 $a1=str_replace("&#x449;","щ",$a1);
 $a1=str_replace("&#x44A;","ъ",$a1);
 $a1=str_replace("&#x44B;","ы",$a1);
 $a1=str_replace("&#x44C;","ь",$a1);
 $a1=str_replace("&#x44D;","э",$a1);
 $a1=str_replace("&#x44E;","ю",$a1);
 $a1=str_replace("&#x44F;","я",$a1);
 $a2=str_replace("&amp;","&",$a1);
$file=fopen("file/$name","w"); fputs($file, $a1); fclose($file); }} 
 ?>


  <form action='trans.php' method='post'>
file name:<br>
  <input type='text' maxlength='20' name='name'>
  <br>code:<br>
  <textarea wrap='virtual' cols='50' rows='20' name='a'>

<?
  if((!$name) || (empty($name)))
  {echo '';} else {
  if($p=='1' && $sel=='a') { echo $a; }
  if($p=='2' && $sel=='a') { echo $a2; }
  if($p=='1' && $sel=='b') { echo $a2; }
  if($p=='2' && $sel=='b') { echo $a; }}
?>

</textarea><br>Вид перевода:<br>
<select name='sel'>
<option selected value='a'>кириллица в UTF-8
<option value='b'>UTF-8 в кириллицу</select><br>Вывод в форме:<br>
<select name='p'>
<option selected value='1'>исходник
<option value='2'>результат</select>
  <br><input type='reset' value='очистить'><br> 
 <input type='submit' value='generate'>
  </form>
<br>  &copy; 254th &amp; maslanin
  </div>  </body>  </html>