<?php
session_start();
//include 'config.php';
//$pass = trim($_POST['pass']);//

 function getfile($mulu){
		if(!file_exists($mulu)) {
                $files="";
				}else{
    $files = file_get_contents($mulu);
		}
	return $files;
}

if($_SESSION['is_login']=="1"){

$action = $_GET['act'];
if ($action == 'yuming') {  
$yuming=$_POST["yuming"];
if ($yuming) {chmod("./data/yuming/", 0777);  file_put_contents("./data/yuming/yuming.txt", $yuming); echo "<script>alert('保存成功!');location.href='guanli.php';</script>'";die;}else{ echo "<script>alert('保存失败!');location.href='guanli.php';</script>'";die;}
}

if ($action == 'keyword') {  
$keyword=$_POST["keyword"];
if ($keyword) {  chmod("./data/keyword", 0777);  file_put_contents("./data/keyword/1.txt", $keyword); echo "<script>alert('保存成功!');location.href='guanli.php';</script>'";die;}else{ echo "<script>alert('保存失败!');location.href='guanli.php';</script>'";die;}
}

if ($action == 'lunlian') {  
$lunlian=$_POST["lunlian"];
if ($lunlian) {file_put_contents("./data/lunlian.txt", $lunlian); echo "<script>alert('保存成功!');location.href='guanli.php';</script>'";die;}else{ echo "<script>alert('保存失败!');location.href='guanli.php';</script>'";die;}
}

   ?>
  <html>
    <head>
        <title>修改配置</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head>
    
    <body>
	<center>欢迎登入后台&nbsp;&nbsp;<a href="guanli.php">管理</a>&nbsp;&nbsp;<a href="admin.php">设置</a>&nbsp;&nbsp;<a href="http://www.kuaicheseo.com/" target="_blank">快车官网</a>&nbsp;&nbsp;<a href="http://www.kuaicheseo.com/forum-42-1.html" target="_blank">程序使用教程</a>&nbsp;&nbsp;<a href="admin.php?action=loginout">退出</a></center><br/>
	
	        <form action='guanli.php?act=keyword' method='post'>
		<center>
            <table border='1' width='600'>
							 <tr>
                    <td align='center' >
					优化关键词管理
                    </td>
                </tr>
				 <tr>
                    <td align='center' >
					<textarea name="keyword" cols="35" rows="25" ><? echo getfile("./data/keyword/1.txt");  ?></textarea>
                    </td>
                </tr>
				                <tr>
                    <td  align='center' >
                        <input type='submit' value='保存' />
                        <input type='reset'  />
                    </td>
                </tr>
            </table>
			</center>
        </form>
		
        <form action='guanli.php?act=yuming' method='post'>
		<center>
            <table border='1' width='600'>
							 <tr>
                    <td align='center' >
					泛域名管理
                    </td>
                </tr>
				 <tr>
                    <td align='center' >
					<textarea name="yuming" cols="35" rows="25" ><? echo getfile("./data/yuming/yuming.txt");  ?></textarea>
                    </td>
                </tr>
				                <tr>
                    <td  align='center' >
                        <input type='submit' value='保存' />
                        <input type='reset'  />
                    </td>
                </tr>
            </table>
			</center>
        </form>
   <form action='guanli.php?act=lunlian' method='post'>
		<center>
            <table border='1' width='600'>
							 <tr>
                    <td align='center' >
					外链管理
                    </td>
                </tr>
				 <tr>
                    <td align='center' >
					<textarea name="lunlian" cols="35" rows="25" ><? echo getfile("./data/lunlian.txt");  ?></textarea>
                    </td>
                </tr>
				                <tr>
                    <td  align='center' >
                        <input type='submit' value='保存' />
                        <input type='reset'  />
                    </td>
                </tr>
            </table>
			</center>
        </form>    </body>
</html>
  <?php
}else{
  $is_login='';
  echo "'<script language='javascript'>location.href='login.php'</script>'"; exit;
 ?>
<?php

  }
 
 ?>