PHP:
<?php
$sql = "SELECT * FROM settings";
$result = mysql_query($sql) or die(mysql_error());
while ($s = mysql_fetch_assoc($result)) {
?>
<form action="info.php?m=system" method="post">
<p>
<label>Име на сайта</label>
<input class="text-input medium-input datepicker" id="medium-input" name="sitename" value="<?php echo $s['sitename'];?>" type="text">
</p>
<p>
<label>Описание</label>
<input class="text-input medium-input datepicker" id="medium-input" name="description" value="<?php echo $s['description'];?>" type="text">
</p>
<p>
<label>Ключови думи</label>
<input class="text-input large-input" id="large-input" name="keywords" value="<?php echo $s['keywords'];?>" type="text">
</p>
<p>
<label>Сезон</label>
<input class="text-input medium-input datepicker" id="medium-input" name="background" value="<?php echo $s['background'];?>" type="text">
</p>
<p>
<label>Автор на системата</label>
<input class="text-input medium-input datepicker" id="medium-input" name="author" value="<?php echo $s['author'];?>" type="text">
</p>
<p>
<label>Темплейт</label>
<input class="text-input small-input" id="small-input" name="style" value="<?php echo $s['style'];?>" type="text">
</p>
<p>
<label>Икона</label>
<input class="text-input medium-input datepicker" id="medium-input" name="favicon" value="<?php echo $s['favicon'];?>" type="text">
</p>
<p>
<label>RSS канал</label>
<input class="text-input medium-input datepicker" id="medium-input" name="rssfeed" value="<?php echo $s['rssfeed'];?>" type="text">
</p>
<p>
<label>Jquery библиотека</label>
<input class="text-input medium-input datepicker" id="medium-input" name="jquery" value="<?php echo $s['jquery'];?>" type="text">
</p>
<p>
<label>Кодировка на сайта</label>
<input class="text-input small-input" id="small-input" name="charset" value="<?php echo $s['charset'];?>" type="text">
</p>
<p>
<input name="edit" class="button" value="Редактирай" type="submit">
<input class="button" value="Изчисти" type="reset">
</p>
</form>
<?php
}
if ($_POST['edit']) {
$sitename = htmlspecialchars(addslashes($_POST['sitename']));
$description = htmlspecialchars(addslashes($_POST['description']));
$keywords = htmlspecialchars(addslashes($_POST['keywords']));
$background = htmlspecialchars(addslashes($_POST['background']));
$author = htmlspecialchars(addslashes($_POST['author']));
$style = htmlspecialchars(addslashes($_POST['style']));
$favicon = htmlspecialchars(addslashes($_POST['favicon']));
$rssfeed = htmlspecialchars(addslashes($_POST['rssfeed']));
$jquery = htmlspecialchars(addslashes($_POST['jquery']));
$charset = htmlspecialchars(addslashes($_POST['charset']));
$edit = "UPDATE settings SET sitename='$sitename', description='$description', keywords='$keywords', background='$background', author='$author', style='$style', favicon='$favicon', rssfeed='$rssfeed', jquery='$jquery', charset='$charset'";
$sql = mysql_query($edit);
echo '
<div class="notification success png_bg">
<a href="#" class="close">
<img src="images/cross_grey_small.png" alt="close" title="Close this notification" height="7" width="7">
</a>
<div>
Информацията за сайта е редактирана успешно!
</div>
</div>
';
}
?>