سلام
مشکل این چیه؟
وقتی ویرایش رو میزنی آپدیت مشه ولی ورودی های پرنمی شه واگه صفحه رو دوباره اجرا کنی آپدیتش خراب می شه خالی می مونه
مشکل این چیه؟
وقتی ویرایش رو میزنی آپدیت مشه ولی ورودی های پرنمی شه واگه صفحه رو دوباره اجرا کنی آپدیتش خراب می شه خالی می مونه
کد:
<?php
session_start();
if ( isset($_SESSION['user']) ) {
if ( (isset($_GET['logout'])) && ($_GET['logout'] == "true") )
{
unset ($_SESSION['user']);
header ("Location: index.php");
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>مدیریت سایت - تنظیمات</title>
<link href="files/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<?php
include "config.php";
include "pdate.php";
?>
<?php
if(isset($_POST['login'])) {
$add=mysql_query ("INSERT INTO `config` VALUES ('".$_POST['title']."', '".$_POST['keywords']."', '".$_POST['desc']."')");
$edit=mysql_query ("UPDATE `config` SET `title` = '".$_POST['title']."', `keywords` = '".$_POST['keywords']."', `desc` = '".$_POST['desc']."' LIMIT 1");
$Query = mysql_query("select * from config");
$row_config = mysql_fetch_array($Query);
}
$title=$_POST['title'];
mysql_query("UPDATE config SET title=$title ")
?>
<?php include("menu.php"); ?>
<div class="content">
<div class="top-text">تنظیمات سایت</div>
<form method="POST" action="setting.php">
<table>
<!--
<tr>
<td>آدرس سایت</td>
<td>:</td>
<td><input type="text" name="siteurl" value="<?php echo $siteurl; ?>" /></td>
</tr>-->
<tr>
<td>عنوان</td>
<td>:</td>
<td><input type="text" name="title" value="<?php echo $row_config['title']; ?>" /></td>
</tr>
<tr>
<td>کلمات کلیدی</td>
<td>:</td>
<td><input type="text" name="keywords" value="<?php echo $row_config['keywords']; ?>" /></td>
</tr>
<tr>
<td>توضیحات</td>
<td>:</td>
<td><input type="text" name="desc" value="<?php echo $row_config['desc']; ?>" /></td>
</tr>
</table>
<input type="submit" name="login" value="ویرایش" />
</form>
</div>
<div class="clear"></div>
</div>
</body></html>
<?php } else { header ("location: index.php"); } ?>