打印本文 打印本文  关闭窗口 关闭窗口
PHP+MYSQL的文章管理系统(一)
作者:采集员 文章来源:来源于网络 点击数: 更新时间:2005/9/10 14:29:59
; ;
        if(mysql_db_query($database,$query))
          echo"数据库 $table 建立成功<BR>".mysql_error();
        else
          echo"数据库 $table 建立失败<BR>";
        $query="CREATE TABLE $ping_tab (
                      id int(4) NOT NULL auto_increment,
                      p_id int(4) DEFAULT '0' NOT NULL,
                      name varchar(50) NOT NULL,
                      mail varchar(200) NOT NULL,
                      p_cont text NOT NULL,
                      time datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
                      ip varchar(15) NOT NULL,
                      PRIMARY KEY (id),
                      UNIQUE id (id),
                      KEY id_2 (id)
                      )";
        if(mysql_db_query($database,$query))
          {
            echo"用户评论数据库 $ping_tab 建立成功<BR>恭喜,文章管理系统安装成功!请<a href=login.php>这边走</a>进行基本设置!<BR>";
            $fp=fopen("setup.php","r");
            $file_cont=fread($fp,filesize("setup.php"));
            $file_cont="<? session_start(); require"./inc/func.php"; check_login(); ?> ".$file_cont;
            $fp=fopen("setup.php","w");
            fputs($fp,$file_cont);
            fclose($fp);
          }
        else
          echo"用户评论数据库$ping_tab建立失败<BR>";
    }
   else
      echo "数据库连接失败!请检测你用户名密码的正确性!<BR>";
  exit();
  }
require "./inc/header.inc";
?>
<script language="javascript">
function db_pwd()
{
  var theResult = true;
  var elem4 = null;

  if (document.forms[0].elements[2].value == "" || document.forms[0].elements[2].value!=document.forms[0].elements[3].value)
  {
    alert("您两次输入的数据库密码不一致,或者为空!");
    document.forms[0].elements[2].value="";
    document.forms[0].elements[3].value="";
    theResult = false;

     }
  return theResult;
}
function admin_pwd()
{
  var theResult = true;
  var elem4 = null;
if (document.forms[0].elements[8].value == "" || document.forms[0].elements[8].value!=document.forms[0].elements[9].value)
  {
    alert("您两次输入的管理员密码不一致,或者为空!");
    document.forms[0].elements[8].value="";
    document.forms[0].elements[9].value="";
    theResult = false;

     }
  return theResult;
}
function go()
{
var theResult=true;
theResult =db_pwd()&&admin_pwd();
return theResult;
}
</script>
</head>
<body bgcolor="#FFFFFF">
<? require "./inc/nav.inc";?>
<form name="form1" method="post" action="<? echo $PHP_SELF; ?>" onsubmit="return go()";>
  <table border="0" cellspacing="0" cellpadding="0" align="center" style=text-align:left;>
    <tr>
      <td colspan="3">
        <div align="center">蓝狐文章管理安装程序<br>
          (请正确填写以下内容否则程序将无法使用)</div>
      </td>
    </tr>
    <tr>
      <td>数据库服务器:</td>
      <td colspan="2">
        <input type="text" name="host" value="localhost" class="border" size="30">
      </td>
    </tr>
    <tr>
      <td>数据库用户名: </td>
      <td colspan="2">
        <input type="text" name="database_usn" class="border" size="30">
      </td>
    </tr>
    <tr>
      <td>数据库用户密码:</td>
      <td colspan="2">
        <input type="password" name="database_pwd" class="border" size="30">
      </td>
    </tr>
    <tr>
      <td>数据库密码确认:</td>
      <td colspan="2">
        <input type="password" name="database_pwd2" class="border" size="30">
      </td>
    </tr>
    <tr>
      <td>数据库名:</td>
      <td colspan="2">
        <input type="text" name="database" class="border" size="30">
      </td>
    </tr>
    <tr>
      <td>存放文章的表:</td>
      <td colspan="2">
        <input type="text" name="table" class="border" size="30">
      </td>
    </tr>
    <tr>
      <td>存放评论的表:</td>
      <td colspan="2">
        <input type="text" name="ping_tab" class="border" size="30">
      </td>
    </tr>
    <tr>
      <td>管理员用户名:</td>
      <td colspan="2">
        <input type="text" name="admin_usn" class="border" size="30">
      </td>
    </tr>
    <tr>
      <td>管理员密码:</td>
      <td colspan="2">
        <input type="password" name="admin_pwd" class="border" size="30">
      </td>
 &

上一页  [1] [2] [3]  下一页



打印本文 打印本文  关闭窗口 关闭窗口