标题:如何让留言内容和管理员回复不顶格(前面空两格)
只看楼主
卡丁龙
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2010-9-18
结帖率:100%
 问题点数:0 回复次数:2 
如何让留言内容和管理员回复不顶格(前面空两格)
程序代码:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.>
<html xmlns="http://www.>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<!--#include file="conn.asp" -->
<!--#include file="admin/function/displaytm.asp" -->

<%
set rs= Server.CreateObject("adodb.recordset")
sql="select * from basic"
rs.open sql,conn,1,1

 %>
<title><%= rs("stname") %></title>
<link href="css.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" type="text/javascript" src="SelectDate.js"></script>
<script language="JavaScript" type="text/javascript">
function js(){
if(document.form1.nc.value==""){
alert("请输入您的姓名!")
document.form1.nc.focus()
return false
}
if(document.form1.lz.value==""){
alert("请输入您的联系方式!")
document.form1.lz.focus()
return false
}
if(document.form1.dz.value==""){
alert("请输入您的联系地址!")
document.form1.dz.focus()
return false
}
if(document.form1.lb.value==""){
alert("请选择留言类型!")
document.form1.lb.focus()
return false
}
if(document.form1.msg.value==""){
alert("请输入留言内容!")
document.form1.msg.focus()
return false
}
}
</script>

<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
.style2 {color: #0000FF}
.style3 {color: #000066}
.style4 {color: #FF0099}
-->
</style>
</head>

<body>
<!--#include file="top.asp" -->

<table width="1000" border="0" align="center" cellpadding="0" cellspacing="0" id="bj">
  <tr>
    <td width="190" height="600" valign="top" ><table width="100%" border="0" cellpadding="0" cellspacing="0" id="bj">
      <tr>
        <td height="5">&nbsp;</td>
      </tr>
    </table>
      <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.,0,29,0" width="200" height="300">
        <param name="movie" value="dh_2.swf" />
        <param name="quality" value="high" />
        <embed src="dh_2.swf" quality="high" pluginspage="http://www. type="application/x-shockwave-flash" width="200" height="300"></embed>
      </object>
    <td height="800" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="25">&nbsp;</td>
      </tr>
    </table>
      <table width="100%" border="0" cellpadding="0" cellspacing="0" id="lbj">
        <tr>
          <td height="28" align="left" class="imp"><img src="imgs/news_tt.gif" width="21" height="21" align="absmiddle" />在线留言</td>
        </tr>
      </table>
      <table width="800" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td height="25" bgcolor="#CCCCCC" class="imp">客户留言</td>
        </tr>
      </table>
      <form id="form1" name="form1" method="post" action="message_js.asp">
        <table width="800" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
          <tr>
            <td width="120" height="30" align="center">姓名:</td>
            <td height="30" align="left"><input name="nc" type="text" id="nc" style=" background:#FFFFFF; color:#333333; height:auto; border:solid 1px #88b5d1" />
              <span class="STYLE1">*</span></td>
          </tr>
          <tr>
            <td width="120" height="30" align="center">联系方式:</td>
            <td height="30" align="left"><input name="lz" type="text" id="lz" style=" background:#FFFFFF; color:#333333; height:auto; border:solid 1px #88b5d1" /><span class="STYLE1">*</span></td></td>
          </tr>
          <tr>
            <td width="120" height="30" align="center">联系地址:</td>
            <td height="30" align="left"><input name="dz" type="text" id="dz" style=" background:#FFFFFF; color:#333333; height:auto; border:solid 1px #88b5d1" /><span class="STYLE1">*</span></td></td>
          </tr>
          <tr>
            <td width="120" height="30" align="center">留言类别:</td>
            <td height="30" align="left"><select name="lb" id="lb">
              <option value="" selected="selected">==请选择留言类别==</option>
              <%
              set rs= Server.CreateObject("adodb.recordset")
              sql="select * from msg_type order by id desc"
              rs.open sql,conn,1,1
              while not rs.eof
               %>
              <option value="<%= rs("id") %>"><%= rs("typ") %></option>
              <%
              rs.movenext
              wend
               %>
            </select>
              <span class="STYLE1">*            </span></td>
          </tr>
          <tr>
            <td width="120" height="30" align="center">验证码:</td>
            <td height="30" align="left"><input name="yzm" type="text" id="yzm" />
              <%
             Randomize
             a=int((9 - 1 + 1) * Rnd + 1)
             b= int((9- 1+ 1) * Rnd + 1)
             c= int((9 - 1 + 1) * Rnd + 1)
             session("c")=a*b+c
              %>
(<font color="red"><%= a %><%= b %><%=c%></font>=?)把运算结果填到左边 </td>
          </tr>
          <tr>
            <td width="120" height="30" align="center">留言:</td>
            <td height="30" align="left"><textarea name="msg" cols="70" rows="10" id="msg"></textarea></td>
          </tr>
          <tr>
            <td width="120" height="30" align="center">&nbsp;</td>
            <td height="30" align="left"><input type="submit" name="Submit" value="提交"  onclick="return js()"/>
            <input type="reset" name="Submit2" value="重置" /></td>
          </tr>
        </table>
      </form><table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
     <%
     set rs= Server.CreateObject("adodb.recordset")
     sql="select msg.* ,msg_type.typ from msg,msg_type where msg.lb=msg_type.id and msg.yz=yes order by msg.id desc"
     rs.open sql,conn,1,1
     page=Trim(Request.QueryString("page"))
        if not ISnumeric(request("page")) or ISempty(request("page")) then page=1
        page=cint(page)
         if not rs.eof then
        rs.pagesize=10
        alpgs=rs.pagecount
                     if page>alpgs then page=alpgs
                     if page<>0 then
                      rs.absolutepage=page
                       else
                        Response.Write("没有符合条件记录!")
                        end if
        
           else
                    Response.Write("<tr><td>数据库中暂无纪录!</td></tr>")
          end if
          for pages=0 to rs.pagesize-1
          if rs.bof or rs.eof then exit for
          if pages<>0 then
          if pages mod 1=0 then
          Response.Write("</tr><tr>")
          end if
          end if
      %>
  <tr>
    <td height="200" valign="top"><table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td height="30" align="left" bgcolor="#ECECEC"><img src="/imgs/123.gif" alt="" height="24" width="24" border="0" /><span class="style2">姓名:<%= rs("nc") %></span>&nbsp;&nbsp;&nbsp;类别:<%= rs("typ") %>&nbsp;&nbsp;发表于:<%= displaytime(rs("mydate")) %></td>
        </tr>
      <tr>
        <td height="60" align="left" bgcolor="#FFFFFF"><img src="/imgs/20085171520323.png" alt="" height="19" width="19" border="0" /><span class="style3"><%= rs("msg") %></span>&nbsp;</td>
        </tr>
      <tr>
        <td height="30" align="left" bgcolor="#ECECEC">&nbsp;</td>
        </tr>
      <tr>
        <td height="30" align="left" bgcolor="#CCCCCC"><img src="/imgs/234.gif" alt="" height="24" width="24" border="0" /><span class="STYLE1">管理员回复:<%= rs("nc") %></span></td>
        </tr>
      <tr>
        <td height="60" align="left" bgcolor="#ECECEC"><img src="/imgs/20085171520865.png" alt="" height="19" width="19" border="0" /><span class="style4"><%= rs("hf") %></span>&nbsp;</td>
        </tr>
    </table></td>
  </tr>
  <%
  rs.movenext
  next
   %>
</table>

     
      <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="30" align="center">每页<font color="#FFFFFF" face="impact"><%= rs.pagesize %></font>/共<font color="#FFFFFF" face="impact"><%= rs.recordcount %></font>条记录
            <% If page<>1 Then %>
              <a href="?page=1&amp;lb=<%= mylb %>">首页</a>
              <% End If %>
              <% If page>1 Then %>
              <a href="?lb=<%= mylb %>&amp;page=<%= page-1 %>">上一页</a>
              <% Else %>
            上一页
            <% End If %>
            <% for pages=1 to alpgs %>
            <a href="?lb=<%= mylb %>&amp; page=<%= pages %>"><%= pages %></a>
            <% next %>
            <% If page<alpgs Then %>
            <a href="?lb=<%= mylb %>&amp;page=<%= page+1 %>">下一页</a>
            <% Else %>
            下一页
            <% End If %>
            <% If page<>alpgs Then %>
            <a href="?page=<%= alpgs %>&amp;lb=<%= mylb %>">尾页</a>
            <% End If %>
            &nbsp;第:<font color="#FFFFFF" face="impact"><%= page %></font>/<font color="#FFFFFF" face="impact"><%= alpgs %></font></td>
        </tr>
      </table></td>
  </tr>
</table>
<!--#include file="footer.asp" -->
</body>
</html>
搜索更多相关主题的帖子: 管理员 留言 顶格 
2010-09-30 11:59
gupiao175
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:40
帖 子:1787
专家分:7527
注 册:2007-6-27
得分:0 
什么叫不顶格啊?空两格还是空两行?

,空两格就用2个&nbsp;空两行就用2个<br>即可!

Q:1428196631,百度:开发地 即可找到我,有事请留言!
2010-10-08 12:25
towering
Rank: 7Rank: 7Rank: 7
等 级:黑侠
威 望:1
帖 子:261
专家分:507
注 册:2007-10-9
得分:0 
楼上说的对!
也可以用CSS来实现。
比如:
text-indent:20px;

我的ASP小站:http://www./
2010-10-08 13:23



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-321744-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.489734 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved