<!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=gb2312" />
<link rel="stylesheet" href="../inc/css.css" type="text/css" />
<title>无标题文档</title>
<style type="text/css">
<!--
.STYLE5 {color: #FFFFFF; font-weight: bold; }
.STYLE6 {color: #FF0000}
-->
</style>
</head>

<body>
<?php

include("../../include/config.php");
$result_cache=mysql_query("select * from extends");
if ($info_cache=mysql_fetch_array($result_cache)) {
	$lifetime=$info_cache['lifetime'];
	$caching=$info_cache['caching'];
}
?>
<form name="form1" method="post">
  <table width="1052" border="0" align="center" cellpadding="2" cellspacing="1" bordercolor="#799AE1" class="tableBorder">
    <tbody>
    
      <tr bgcolor="#CCCCCC">
        <td height="20" colspan="2" bgcolor="#4455aa"><div align="center" class="STYLE5">
            <div align="left">网站缓存设置</div>
        </div></td>
      </tr>
       <tr bgcolor="#DEE5FA">
        <td align="center" class="txlrow"><div align="center">开启网站缓存：</div></td>
        <td width="943" align="center" class="txlrow"><div align="left">
         <input type="radio" name="caching" <?php if ($caching==1) echo "checked='checked'";?>  value="1"/> 是 <input type="radio" name="caching" <?php if ($caching==0) echo "checked='checked'";?> value="0" /> 否
</td>
      </tr>
      <tr bgcolor="#DEE5FA">
        <td align="center" class="txlrow"><div align="center">网站缓存时间：</div></td>
        <td align="center" class="txlrow"><div align="left">
            <input type="text" name="lifetime" value="<?php echo $lifetime; ?>"  />秒 
            <span class="STYLE6">*</span></div></td>
      </tr>
     

      <tr bgcolor="#DEE5FA">
        <td align="center" class="txlrow">&nbsp;</td>
        <td align="center" class="txlrow"><div align="left">
            <input type="submit" name="ok" value="提交"  />
            <input type="reset" name="button" id="button" value="重置" />
        </div></td>
      </tr>
    </tbody>
  </table>
</form>
<?php
if ($_POST[ok]) {
$lifetime=$_POST[lifetime];
$caching=$_POST[caching];
mysql_query("set names 'gbk'");
$result=mysql_query("update extends set  lifetime=$lifetime,caching=$caching");
if ($result) {
echo "<script>alert('设置成功');location='index.php';</script>";
} else {
echo "<script>alert('设置失败');location='index.php';</script>";
}
}
?>
</body>
</html>




