Файл: panel/contacts.php
Строк: 38
<?PHP
require '../Core/start.php';
$title = 'Контакты';
require '../Core/header.php';
if(!isset($user)){header('Location: /');}
if(isset($_POST['go']))
{
$email = text($_POST['email']);
$telephone = text($_POST['telephone']);
$skype = text($_POST['skype']);
$icq = text($_POST['icq']);
mysql_query("UPDATE `contacts` SET `value` = '$email' WHERE `key` = 'email'");
mysql_query("UPDATE `contacts` SET `value` = '$telephone' WHERE `key` = 'telephone'");
mysql_query("UPDATE `contacts` SET `value` = '$skype' WHERE `key` = 'skype'");
mysql_query("UPDATE `contacts` SET `value` = '$icq' WHERE `key` = 'icq'");
message('Контакты успешно сохранены');
}
$cont3 = array();
$cont2 = mysql_query("SELECT * FROM `contacts`");
while($item = mysql_fetch_array($cont2))
{
$cont[$item['key']] = $item['value'];
}
?>
<div class="menu">
<form action="" method="POST">
Email:<br />
<input type="text" name="email" value="<?=on_text($cont['email'])?>"><br />
О нас<br />
<input type="text" name="telephone" value="<?=on_text($cont['telephone'])?>"><br />
Skype:<br />
<input type="text" name="skype" value="<?=on_text($cont['skype'])?>"><br />
Icq:<br />
<input type="text" name="icq" value="<?=on_text($cont['icq'])?>"><br />
<input type="submit" name="go" value="Сохранить">
</form>
</div>
<div class="back"><a href="/panel/">В админ-панель</a></div>
<?
require '../Core/footer.php';
?>