File size: 1.43Kb
<?php
@$pas=$_GET['pas'];
@$n=$_GET['n'];
@$do=$_POST['do'];
require('ini.php');
Header('Content-Type: application/xhtml+xml;charset=utf-8');
Header('Cache-Control: no-cache, must-revalidate');
print '<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru"><head><title>Edit Theme</title>
<link rel="stylesheet" type="text/css" href="style.css" /></head><body><div>';
$arr=file('themes.dat');
@$tsa=explode(':||:',$arr[$n]);
if($do!='' and $pas==$admp and $n){
@$tname=htmlspecialchars($_POST['tname']);
if($tname=='') die('Ошибка. Не заполнено поле.</div></body></html>');
$tname=str_replace(':||:','',$tname);
$tsa[1]=trim($tname);
$arr[$n]=implode(':||:',$tsa);
$f=fopen('themes.dat','w');
$d=implode('',$arr);
fputs($f,$d);
fclose($f);
echo 'Название темы изменено.<hr />';
}elseif($pas==$admp and $n!=''){
echo '<form action="edittheme.php?pas='.$pas.'&n='.$n.'" method="post"><div>
<span class="bl">Название темы:</span>
<input type="text" name="tname" value="'.htmlspecialchars($tsa[1]).'" size="14" /><br />
<input type="submit" name="do" value="Изменить" />
</div></form><hr />';
}else echo 'Ошибка.<hr />';
print '[<a href="index.php?pas='.$pas.'">Вернуться</a>]</div></body></html>';
?>