View file jpmobile/adm/red_menu.php

File size: 955B
<?php
echo
'<span class="ramka">
Редактировать меню.
</span><br>';

if ($_POST['pokas'] != 1)
{
$fp = fopen ('menu/menu.txt', "r");
$buffer = fread($fp, filesize('menu/menu.txt'));
fclose ($fp);
$buffer = str_replace('<!--//line//-->',"\r\n",$buffer);
echo
'
<form name="" action="" method="post">
<textarea name="menu" rows=15 cols=60>'.$buffer.'</textarea>
<input name="pokas" type="hidden" value="1">
<br>
<input class="knopka" type="submit" value="Изменить">
</form>
';
}
else
{
 $buffer = $_POST['menu'];
 $buffer = str_replace('\"','"',$buffer);
 $buffer = str_replace('\'','"',$buffer);
 $buffer = str_replace("\r\n",'<!--//line//-->',$buffer);
 $fp = fopen ('menu/menu.txt', "w+");
 fwrite ($fp, stripslashes($buffer));
 fclose ($fp);
 echo '
   <span class="ramka">
   Успешно!
   </span>
   <a href="/adminf.php?m='.$_GET['m'].'&id='.$_GET['id'].'">Далее</a>
   ';
}


?>