Viewing File: /people/testlab/www/testlab.com.pl/panel/zapisz_stopke.php
<?
include('../config.php');
if (!islogin()) die();
include('../inc/db.php');
$db = new DBConnect();
$sql = "select * from `ustawienia` where typ='footer_left';";
$result = $db->query($sql);
if ($row=$db->fetchrow())
{
$sql= "UPDATE `ustawienia` SET `text` = '".$_POST['footer_left']."' where typ='footer_left';";
$result = $db ->query($sql);
$sql= "UPDATE `ustawienia` SET `text` = '".$_POST['footer_right']."' where typ='footer_right';";
$result = $db ->query($sql);
}
else
{
$sql = "insert into `ustawienia` (typ,text) values ('footer_left','".$_POST['footer_left']."');";
$result = $db->query($sql);
$sql = "insert into `ustawienia` (typ,text) values ('footer_right','".$_POST['footer_right']."');";
$result = $db->query($sql);
}
if ($result != 0) echo "<font color=green>Zmiany zostały zapisane.</font>";
else echo "<font color=red>Wystąpił błąd podczas zapisu danych!</font>";
?>
Back to Directory
File Manager