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

📄 index.php

📁 php+ajax开发源码使用代码下载后就可使用学习
💻 PHP
字号:
<html>
<head>
<script type="text/javascript" src="js/show.js"></script>
<link href="default.css" rel="stylesheet" type="text/css" />
<title>笨小孩 PHP+MYSQL+AJAX 留言本</title>
</head>
<!--此留言本是本人首次使用ajax的作品,不足之处还有很多,欢迎大家指教。本人博客 www.benxiaohai.com  -->
<body onLoad="showpage('action_show.php')">
<!-- 登陆 -->
<div id="login" style="display:none">
    <table width="200" border="0" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF" class="table-1" onMouseDown="f_mdown(this)" onMouseMove="f_move(this)">
      <form method="post" action=""><tr>
        <td height="25" colspan="2" class="td-bg-3" style="CURSOR: move"><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="84%">用户登陆</td>
              <td width="16%"><a onClick="displays('login','none')" style="CURSOR: hand">关闭</a></td>
            </tr>
        </table></td>
      </tr>
      <tr>
        <td width="61" height="25" align="right" class="td-bg-2">用户名:</td>
        <td width="134" class="td-bg-2"><input name="user" type="text" id="user" size="12" onFocus="this.select()"></td>
      </tr>
      <tr>
        <td height="25" align="right" class="td-bg-2">密&nbsp; 码:</td>
        <td class="td-bg-2"><input name="pass" type="text" id="pass" size="12" onFocus="this.select()"></td>
      </tr>
      <tr>
        <td height="25" colspan="2" align="center" class="td-bg-2"><label>
          <input type="button" name="Submit" value="提 交" onClick="login()">
           <input type="reset" name="Submit2" value="重 置">
        </label></td>
      </tr></form>
  </table>
</div>
<!-- 回复 -->
<div id="rel" style="display:none">
    <table width="300" border="0" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF" class="table-1" onMouseDown="f_mdown(this)" onMouseMove="f_move(this)">
      <form method="post" action=""><tr>
        <td height="25" colspan="2" class="td-bg-3" style="CURSOR: move"><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="90%">版主回复</td>
              <td width="10%"><a onClick="displays('rel','none')" style="CURSOR: hand">关闭</a></td>
            </tr>
        </table></td>
      </tr>
      <tr>
        <td colspan="2" align="center" class="td-bg-2"><label>
          <textarea name="relcontent" cols="38" rows="6" id="relcontent"></textarea>
        </label></td>
        </tr>
      
      <tr>
        <td height="25" colspan="2" align="center" class="td-bg-2"><label>
          <input type="button" name="Submit" value="提 交" onClick="rels('','','submit')">
           <input type="reset" name="Submit2" value="重 置">
           <input name="relid" type="hidden" id="relid">
           <input name="relpage" type="hidden" id="relpage">
        </label></td>
      </tr></form>
  </table>
</div>

<!-- 留言 -->
<div id="addbook" style="display:none">
  <table width="400" border="0" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF" class="table-1" onMouseDown="f_mdown(this)" onMouseMove="f_move(this)">
    <form name="addbook" method="post" action="">
      <tr>
        <td height="25" colspan="2" class="td-bg-3" style="CURSOR: move"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="90%">添加留言</td>
            <td width="10%"><a onClick="displays('addbook','none')" style="CURSOR: hand">关闭</a></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td width="85" height="25" align="right" class="td-bg-2">昵 称:</td>
        <td width="302" class="td-bg-2"><input name="name" type="text" id="name" size="20" maxlength="20" onFocus="this.select()">
            <span class="color-red"> *</span></td>
      </tr>
      <tr>
        <td height="25" align="right" class="td-bg-2">邮 箱:</td>
        <td class="td-bg-2"><input name="email" type="text" id="email" size="20" maxlength="60" onFocus="this.select()"></td>
      </tr>
      <tr>
        <td height="25" align="right" class="td-bg-2">Q Q:</td>
        <td height="25" class="td-bg-2"><input name="qq" type="text" id="qq" size="20" maxlength="10" onFocus="this.select()"></td>
      </tr>
      <tr>
        <td height="25" align="right" class="td-bg-2">主 页:</td>
        <td height="-2" class="td-bg-2"><input name="upage" type="text" id="upage" size="20" maxlength="60" onFocus="this.select()"></td>
      </tr>
      <tr>
        <td height="25" align="right" class="td-bg-2">标 题:</td>
        <td height="0" class="td-bg-2"><input name="title" type="text" id="title" size="20" maxlength="60" onFocus="this.select()">
          <span class="color-red">*</span>
            <input name="start" type="checkbox" id="start" value="1">
            给版主的悄悄话
            </td>
      </tr>
      <tr>
        <td height="25" align="right" class="td-bg-2">内 容:</td>
        <td height="25" class="td-bg-2"><textarea name="content" cols="30" rows="4" id="content"></textarea>
            <span class="color-red">*</span></td>
      </tr>
      <tr>
        <td height="25" colspan="2" align="center" class="td-bg-2"><input type="button" name="Submit3" value="提 交" onClick="add()">
            <input type="reset" name="Submit22" value="重 置"></td>
      </tr>
    </form>
  </table>
</div>
<input type="hidden" id="nextpage" name="nextpage">
<input type="hidden" id="pages" name="pages">
<input type="hidden" id="uppage" name="uppage">
<input type="hidden" id="totalpage" name="totalpage">
<table width="778" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="60" align="center" valign="top" class="td-bg-2"><table width="96%" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td height="10"></td>
      </tr>
    </table>
      <table width="96%" border="0" align="center" cellpadding="0" cellspacing="1" class="table-1">
      <tr>
        <td height="40" class="td-bg-1"> &nbsp;<span class="STYLE2">笨小孩 PHP+MYSQL+AJAX 留言本</span></td>
      </tr>
    </table>
      <table width="96%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td height="10"></td>
        </tr>
      </table>
      <table width="96%" border="0" align="center" cellpadding="0" cellspacing="1" class="table-1">
        <tr>
          <td height="25" align="right" class="td-bg-3"><a onClick="displays('addbook','')" style="CURSOR: hand">添加留言</a>&nbsp;&nbsp; <a onClick="displays('login','')" style="CURSOR: hand">管理登陆</a>&nbsp;&nbsp;&nbsp; </td>
        </tr>
      </table>
      <table width="96%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td height="10"></td>
        </tr>
      </table>
	  <div align="center" id="loading"></div>
	  <div align="center" id="bookcontent" style="width:100%"></div>
      <table width="96%" border="0" align="center" cellpadding="0" cellspacing="1" class="table-1">
        <tr>
          <td height="25" align="center" class="td-bg-3"><table border="0" align="right" cellpadding="0" cellspacing="0">
            <tr>
              <td width="180" align="center"><a onClick="showpage('action_show.php')" style="CURSOR: hand">首页</a> <a onClick="actionpage('uppage')" style="CURSOR: hand">上一页</a> <a onClick="actionpage('nextpage')" style="CURSOR: hand">下一页</a> <a onClick="actionpage('totalpage')" style="CURSOR: hand">尾页</a> </td>
              <td width="60" align="center" id="pagenum"></td>
              <td width="19">&nbsp;</td>
            </tr>
          </table></td>
        </tr>
      </table>
      <table width="96%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td height="10"></td>
        </tr>
      </table>
      <table width="96%" border="0" align="center" cellpadding="0" cellspacing="1" class="table-1">
        <tr>
          <td height="25" align="center" class="td-bg-1">&nbsp;<a href="http://www.benxiaohai.com">笨小孩</a> &copy; 版权所有</td>
        </tr>
      </table>
      <table width="96%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td height="10"></td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

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