File size: 1.21Kb
<?php
include("../config.php");
include("../templates/head.php");
echo"<div class=\"a\">";
echo"Админка";
echo"</div>";
echo"<p>";
echo"<div class=\"c\">";
echo"Настройка<p>";
if($_SERVER['QUERY_STRING'] == "login=$admin&pass=$pass")
{
$admin = $_POST['admin'];
$password = $_POST['pass'];
$email = $_POST['email'];
$title = $_POST['title'];
$index = $_POST['index'];
$skin = $_POST['skin'];
$mpass = md5($password);
if($_POST['admin'] == "" || $_POST['pass'] == "" || $_POST['email'] == "" || $_POST['title'] == "" || $_POST['index'] == "")
{
echo"Вы не заполнили все поля помеченные *<p>";
echo"<a href=\"main.php?login=$admin&pass=$pass\">Назад</a></br>";
}
else
{
$file = "../config.php";
$write = fopen($file,"w+");
fwrite($write,"<?php
\$admin = \"$admin\";
\$pass = \"$mpass\";
\$email = \"$email\";
\$title = \"$title\";
\$index = \"$index\";
\$skin = \"$skin\";
\$r = rand(0,999999999);
?>");
fclose($write);
echo "Данные сохранены<p>";
echo"<a href=\"main.php?login=$admin&pass=$pass\">Назад</a></br>";
}
}
else
{
echo"Ошибка авторизации";
}
echo"</div>";
include("../templates/foot.php");
?>