⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_set.php

📁 我们运用一个小的记事本
💻 PHP
字号:
<?php
include 'check.php';
include 'include/config.php';
include 'include/para.php';
$page=$_GET['page'];
if (empty($page)) $page=1;
$pageUrl=$_SERVER['PHP_SELF'];
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>设置留言本 - <?php echo $gb_name?></title>
<link href="include/css.css" rel="stylesheet" type="text/css">
</head>
<body>
<?php include 'include/head.php';
if(empty($_POST['ac'])){?>
<form name="form1" method="post" action="<?php $_SERVER['PHP_SELF']?>" onSubmit="return FrontPage_Form1_Validator(this)">
  <table width="750" border="0" align="center" cellpadding="0" cellspacing="10" bgcolor="#FFFFFF">
    <tr>
      <td align="center">
		<table width="97%" border="0" cellpadding="0" cellspacing="15" bgcolor="#EBF5FE">
          <tr> 
            <td align="center" valign="top" bgcolor="#FFFFFF"><table width="100%" border="0" cellpadding="6" cellspacing="0" class="border2">
                <tr>
                  <td align="center"><table width="100%" border="0" cellspacing="5" cellpadding="0">
                      <tr> 
                        <td width="9%" align="center"><font color="#0066FF"><img src="images/admin_set.gif" width="36" height="36"></font></td>
                        <td width="91%" class="font16"><img src="images/set.gif" width="142" height="28"></td>
                      </tr>
                    </table>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr> 
                        <td> 
                        
                          <table width="100%" border="0" cellspacing="10" cellpadding="8">
                            <tr> 
                              <td width="23%" align="right" valign="top"> <p><br>
                                  <a href="admin_mp.php"><font color="#175CBB">·修管理密码</font></a></p>
                                <p><a href="admin_set.php"><font color="#175CBB">·留言本设置</font></a></p></td>
                              <td width="77%"><table width="100%" border="0" cellspacing="5" cellpadding="2">
                                  <tr> 
                                    <td width="22%" align="right">留言本的名称:</td>
                                    <td width="78%"><input name="gb_name" type="text" id="gb_name" value="<?php echo $gb_name;?>"> 
                                      <font color="#999999">显示在IE标题栏的文字</font></td>
                                  </tr>
                                  <tr> 
                                    <td align="right">留言本LOGO:</td>
                                    <td><input name="gb_logo" type="text" id="gb_logo" value="<?php echo $gb_logo;?>" size="35"> 
                                      <font color="#999999">留言本左上角的小图片</font></td>
                                  </tr>
                                  <tr> 
                                    <td align="right">网站首页地址:</td>
                                    <td><input name="index_url" type="text" id="index_url" value="<?php echo $index_url;?>"> 
                                      <font color="#999999">点击留言本“网站首页”后的地址</font></td>
                                  </tr>
                                  <tr> 
                                    <td align="right">每页显示留言:</td>
                                    <td><select name="pageT" id="pageT">
                                        <?php //生成数组
	$page_array=array('5','8','10','15','20','25');
	foreach($page_array as $pageT){
		if($page_==$pageT){
		echo "<option value=".$pageT." selected>".$pageT."</option>\n";
		}else{
		echo "<option value=".$pageT.">".$pageT."</option>\n";
		}
	}
	?>
                                      </select>
                                      条 <font color="#666666"><font color="#999999">浏览留言的时候每页显示的条数</font></font></td>
                                  </tr>
                                  <tr> 
                                    <td align="right">连续留言间隔:</td>
                                    <td><select name="timejgT" id="timejgT">
                                        <?php //生成数组
	$timejg_array=array('20','40','60','120','240','360');
	foreach($timejg_array as $timejgT){
		if($timejg==$timejgT){
		echo "<option value=".$timejgT." selected>".$timejgT."</option>\n";
		}else{
		echo "<option value=".$timejgT.">".$timejgT."</option>\n";
		}
	}
	?>
                                      </select>
                                      秒 <font color="#999999">同一个IP连续留言的时间间隔,以防滥发留言</font></td>
                                  </tr>
                                  <tr>
                                    <td align="right">回复时显示:</td>
                                    <td><input name="replyadmtit" type="text" id="replyadmtit" value="<?php echo $replyadmtit;?>"></td>
                                  </tr>
                                  <tr> 
                                    <td align="right">留言审核显示:</td>
                                    <td> <input name="ifauditing" type="checkbox" id="ifauditing" <?php if($ifauditing==1) echo 'checked';?> value="1"> 
                                      <font color="#999999">选中此项后,新留言需要管理员审核后才能显示                                      </font></td>
                                  </tr>
                                  <tr> 
                                    <td height="50"> <input name="ac" type="hidden" id="ac" value="reply">
                                      <script language=JavaScript>
function FrontPage_Form1_Validator(theForm)
{
  if (theForm.gb_name.value == "")
  {
    alert("留言本名称不能空!");
    theForm.gb_name.focus();
    return (false);
  }
  if (theForm.gb_logo.value == "")
  {
    alert("留言本LOGO不能空!");
    theForm.gb_logo.focus();
    return (false);
  }
  
  if (theForm.index_url.value == "")
  {
    alert("网站首页地址不能空!");
    theForm.index_url.focus();
    return (false);
  }
   return (true);
}
</script> </td>
                                    <td><input type="submit" name="Submit" value=" 提 交 设 置 "></td>
                                  </tr>
                                </table></td>
                            </tr>
                          </table></td>
                      </tr>
                    </table></td>
                </tr>
              </table></td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
</form>
<?php }else{?>
<table width="750" border="0" align="center" cellpadding="0" cellspacing="10" bgcolor="#FFFFFF">
  <tr> 
    <td><table width="97%" border="0" align="center" cellpadding="0" cellspacing="15" bgcolor="#EBF5FE">
        <tr> 
          <td align="center" bgcolor="#FFFFFF"><table width="100%" border="0" cellpadding="6" cellspacing="0" class="border2">
              <tr>
                <td align="center"> 
<?php

				$gb_name= $_POST["gb_name"];
				$gb_logo=$_POST["gb_logo"];
				$index_url=$_POST["index_url"];
				$pageT= $_POST["pageT"];
				$timejgT=$_POST["timejgT"];
				$replyadmtit=$_POST["replyadmtit"];
				$ifauditing=$_POST["ifauditing"];
			
$parafile="<"."?php

\$gb_name= '$gb_name';
\$gb_logo='$gb_logo';
\$index_url='$index_url';
\$page_= '$pageT';
\$timejg='$timejgT';
\$replyadmtit='$replyadmtit';
\$ifauditing='$ifauditing';

?".">";

// write the para file
$filenum = fopen ("include/para.php","w");
ftruncate($filenum, 0);
fwrite($filenum, $parafile);
fclose($filenum);
	echo "<img src=\"images/success.gif\"> <font style=font-size:12pt;color=green>设置已保存,请稍候……</font><br><a href=".$pageUrl.">如果浏览器没有自动返回,请点击此处返回</a>";
	echo "<meta http-equiv=\"refresh\" content=\"2; url=".$pageUrl."\">";
?>
                </td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
</table>
<?php }?>
<?php include 'include/foot.php';?>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -