View file admin/links_save.php

File size: 1.55Kb
<?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")
{

$ss1 = $_POST['ss1'];
$ss2 = $_POST['ss2'];
$ss3 = $_POST['ss3'];
$ss4 = $_POST['ss4'];
$ss5 = $_POST['ss5'];
$ss6 = $_POST['ss6'];

$ss1_name = $_POST['ss1name'];
$ss2_name = $_POST['ss2name'];
$ss3_name = $_POST['ss3name'];
$ss4_name = $_POST['ss4name'];
$ss5_name = $_POST['ss5name'];
$ss6_name = $_POST['ss6name'];

if($_POST['ss1']!="http://")
{
$link1 = "<a href=\\\"$ss1\\\">$ss1_name</a>";
}
if($_POST['ss2']!="http://")
{
$link2 = "<a href=\\\"$ss2\\\">$ss2_name</a>";
}
if($_POST['ss3']!="http://")
{
$link3 = "<a href=\\\"$ss3\\\">$ss3_name</a>";
}
if($_POST['ss4']!="http://")
{
$link4 = "<a href=\\\"$ss4\\\">$ss4_name</a>";
}
if($_POST['ss5']!="http://")
{
$link5 = "<a href=\\\"$ss5\\\">$ss5_name</a>";
}
if($_POST['ss6']!="http://")
{
$link6 = "<a href=\\\"$ss6\\\">$ss6_name</a>";
}

$file = "../data/data_links.dat";
$write = fopen($file,"w+");
fwrite($write,"<?php
\$link1 = \"$link1\";
\$link2 = \"$link2\";
\$link3 = \"$link3\";
\$link4 = \"$link4\";
\$link5 = \"$link5\";
\$link6 = \"$link6\";
?>");
fclose($write);
echo"Данные сохранены<p>";
echo"<a href=\"main.php?login=$admin&pass=$pass\">Назад</a></br>";
}
else
{
echo"Ошибка авторизации";
}
echo"</div>";
include("../templates/foot.php");

?>