| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 950 人关注过本帖
标题:求助啊
只看楼主 加入收藏
ehvuclz
Rank: 1
等 级:新手上路
帖 子:65
专家分:0
注 册:2005-8-12
收藏
 问题点数:0 回复次数:17 
求助啊
图片附件: 游客没有浏览图片的权限,请 登录注册

帮我看看。内容里的字段。怎样才能让它在一行里出现一定数量的字符后自动换行。
跪求啊。。

[此贴子已经被hxfly于2005-12-14 11:17:47编辑过]

2005-12-14 11:16
hxfly
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:5810
专家分:118
注 册:2005-4-7
收藏
得分:0 
我知道
我不告诉你!~

2005-12-14 11:17
hxfly
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:5810
专家分:118
注 册:2005-4-7
收藏
得分:0 
需要在插入数据库的时候处理,如果加入数据库前没有处理的话,那就麻烦了

2005-12-14 11:20
ehvuclz
Rank: 1
等 级:新手上路
帖 子:65
专家分:0
注 册:2005-8-12
收藏
得分:0 
跟没说一样。。。那需要怎么弄啊。。有代码就发上来啊

我菜。我学习
2005-12-14 11:23
caiyakang
Rank: 2
等 级:新手上路
威 望:5
帖 子:2111
专家分:0
注 册:2005-3-24
收藏
得分:0 

content=replace(content,"chr(13)","<br>")


中国人的财富网:http://www..cn/
2005-12-14 11:25
hxfly
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:5810
专家分:118
注 册:2005-4-7
收藏
得分:0 
你在输出的时候加上这个标签试试
<pre>文字内容<pre>

2005-12-14 11:30
ehvuclz
Rank: 1
等 级:新手上路
帖 子:65
专家分:0
注 册:2005-8-12
收藏
得分:0 

怎么个使用方法。我把代码复制上来



<!-- #include file="conn.asp" -->
<!-- #include file="chkinput.asp" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>.::发言::.</title>
<link href="other/td.css" rel="stylesheet" type="text/css">
</head>
<!--#include file="ubb.asp"-->


<body>
<%if request("action")="" then%>
<form action="speak.asp?action=yes" method="post" name="frmadd" id="frmadd">
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="590"> <table width="750" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="46"><img src="images/i_23.gif" width="46" height="31"></td>
<td width="676" background="images/i_24.gif">&nbsp;</td>
<td width="28"><img src="images/i_28.gif" width="47" height="31"></td>
</tr>
</table></td>
</tr>
<tr>
<td height="210" background="images/i_29.gif"><table width="669" height="815" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="32" colspan="2"> <div align="center"><font color="#FFFFFF" size="3"><img src="images/fble.gif" width="150" height="30"></font></div></td>
</tr>
<tr>
<td width="118" height="20">&nbsp;</td>
<td width="551" height="20">&nbsp;</td>
</tr>
<tr>
<td height="25" class="a1"><strong>留言人:</strong></td>
<td height="25" class="a1"><input name="username" type="text" id="username">
</td>
</tr>
<tr>
<td height="25" class="a1"><strong>主题:</strong></td>
<td height="25" class="a1"> <input name="motif" type="text" id="motif"></td>
</tr>
<tr>
<td height="25" class="a1"><strong>个人主页:</strong></td>
<td height="25" class="a1"><input name="home" type="text" id="motif3"></td>
</tr>
<tr>
<td height="25" class="a1"><strong>悄悄话:</strong></td>
<td height="25" class="a1"><select name="yn" id="yn">
<option value="Y">是</option>
<option value="N" selected>否</option>
</select></td>
</tr>
<tr>
<td height="25" class="a1"><strong>E_mail:</strong></td>
<td height="25" class="a1"><input name="email" type="text" id="email"></td>
</tr>
<tr>
<td height="25" class="a1"><strong>OICQ:</strong></td>
<td height="25" class="a1"><input name="oicq" type="text" id="motif5"></td>
</tr>
<tr>
<td height="86" class="a1"><strong>头像:</strong></td>
<td height="86" class="a1">&nbsp; <select name="face1" class="box" id="face1" onChange="document.images['face'].src=options[selectedIndex].value;">
<% dim i,facestr,face
face="face/1.gif"
for i=1 to 36
Response.Write "<option "
facestr="face/" & i & ".gif"
Response.Write "value='" & facestr &"'>头像" &i &"</option>"
next%>
</select> &nbsp;&nbsp;<img id=face src="<%=face%>" alt="Head portrait"></td>
</tr>
<tr>
<td height="104" valign="top" class="a1"><p><br>
<strong>当前心情 </strong><br>
&#8226; 将放在帖子的前面</p></td>
<td height="104" class="a1"> <table width="83%" height="83" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="30"> <input name="face" type="radio" value="face1" checked>
<img src="images/face1.gif" width="19" height="19"></td>


</tr>
<tr>
<td height="30"> <input type="radio" name="face" value="face10">
<img src="images/face10.gif" width="19" height="19"> </td>

</tr>

</tr>
</table></td>
</tr>
<tr>
<td height="118" class="a1"><strong>&nbsp;&nbsp;Ubb标签</strong></td>
<td height="118" colspan="3"> <TABLE cellPadding=0 cellSpacing=0 height=84 width="103%">
<TBODY>
<TR>
<TD><img onclick=bold() align=absmiddle src="pic/icon_editor_bold.gif" width="22" height="22" alt="粗体" border="0">

<img onclick=hyperlink() align=absmiddle src="pic/icon_editor_url.gif" width="22" height="22" alt="超级连接" border="0">
<img onclick=emails() align=absmiddle src="pic/icon_editor_email.gif" width="23" height="22" alt="Email连接" border="0">

<IMG onclick=shadow() align=absmiddle height=22 alt=阴影字 src="pic/shadow.gif" width=23 border=0><br>
</TD>
</TR>
<TR>
<TD height="22">字体:
<select onChange=showfont(this.options[this.selectedIndex].value) name=font>
<option value="宋体" selected>宋体</option>
<option value="楷体_GB2312">楷体</option>
<option value="新宋体">新宋体</option>

<option value="Lucida Console">Lucida Console</option>
</select>
字体大小
<select name="size" onChange="showsize(this.options[this.selectedIndex].value)">
<option value="1">1</option>
<option value="2">2</option>
<option value="3" selected>3</option>
<option value="4">4</option>
</select>
颜色:
<select onChange=showcolor(this.options[this.selectedIndex].value) name=color>
<option style="background-color:#F0F8FF;color: #F0F8FF" value="#F0F8FF">#F0F8FF</option>
</select></TD>
</TR>
</TBODY>
</TABLE>
<p class="a1">&nbsp;</p></td>
</tr>
<tr>
<td height="225" valign="top" class="a1"><strong><br>
内容:</strong></td>
<td height="225" class="a1"> <textarea name="content" cols="40" rows="5" id="content" wrap=VIRTUAL></textarea></td>
</tr>
<TR>
<TD height=37 colSpan=4 class="a1"><br>
点击表情图即可在贴子中加入相应的表情<BR> &nbsp;
<% dim d
for d=1 to 24
response.write "<img src=em/em"&(d)&".gif border=0 onclick=""insertsmilie('[em"&d&"]')"" style=""CURSOR: hand""> "
next %>
</TD>
</TR>
<tr>
<td height="43" colspan="2"> <div align="center">
<input type="submit" name="Submit" value="提交">
&nbsp;
<input type="reset" name="Submit2" value="重置">
</div></td>
</tr>
</table></td>
</tr>
<tr>
<td><table width="750" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="46"><img src="images/i_31.gif" width="46" height="32"></td>
<td width="657" background="images/i_32.gif">&nbsp;</td>
<td width="47"><img src="images/i_36.gif" width="47" height="32"></td>
</tr>
</table></td>
</tr>
</table>
</form>
<%end if
if request("action")="yes" then
dim username,motif,u_content,face2,sql,rs,errmsg,home,email,oicq,yn,face1
username=request.form("username")
motif=request.form("motif")
u_content=request.form("content")
face2=request.form("face")
home=request.form("home")
email=request.form("email")
oicq=request.form("oicq")
yn=request.form("yn")
face1=request.form("face1")
if username="" then
errmsg=errmsg+"<br>"+"<li>"+"输入留言人"
end if
if motif ="" or u_content="" then
errmsg=errmsg+"<br>"+"<li>"+"你没有在主题或内容里输入内容"
end if
if IsValidEmail(email)=false then
errmsg=errmsg+"<br>"+"<li>"+"您的Email有错误"
end if

if errmsg="" then
set rs=server.createobject("adodb.recordset")
sql="select * from [content] where username is null"
rs.open sql,conn,1,3
rs.addnew
rs("username")=username
rs("user_content")=u_content
rs("motif")=motif
rs("face")=face2
rs("data")=date()
rs("face1")=face1
rs("home")=home
rs("oicq")=oicq
rs("email")=email
rs("YN")=yn
rs.update
rs.close
set rs=nothing
%>

<table width="48%" border="0" align="center" cellpadding="0" cellspacing="0" class="unnamed1">
<tr>
<td height="66" bgcolor="#BBF1FF"> <p align="center"><br>
恭喜你,<%=username%>.你成功发言,谢谢你的意见。</p>
<p align="center"><a href="index.asp"> 点击返回</a><br>
<br>
</p></td>
</tr>
</table>
<%else%>
<table width="48%" border="0" align="center" cellpadding="0" cellspacing="0" class="unnamed1">
<tr>
<td bgcolor="#BBF1FF"><br>
&nbsp;&nbsp;&nbsp;&nbsp; 对不起,你没有成功发言,因以下错误:<br>
&nbsp;&nbsp;&nbsp;&nbsp;<%=errmsg%> <p align="center"><a href="javascript:history.back(-1)">点击返回前一页</a><br>
<br>
</p>
</td>
</tr>
</table>
<%end if
end if%>
</body>
</html>


我菜。我学习
2005-12-14 11:32
hxfly
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:5810
专家分:118
注 册:2005-4-7
收藏
得分:0 
或者在数据库插入信息前用下面这个
function ck(str)
str=server.HTMLEncode(str)
str=replace(str,vbcrlf,"<br>")
str=replace(str,chr(13),"<br>")
str=replace(str," ","&nbsp;")
ck=str
end function
用法
username=ck(request.form("username"))

2005-12-14 11:32
hxfly
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:5810
专家分:118
注 册:2005-4-7
收藏
得分:0 

方便的话把整个系统发到我油箱里面我给你看看


2005-12-14 11:34
ehvuclz
Rank: 1
等 级:新手上路
帖 子:65
专家分:0
注 册:2005-8-12
收藏
得分:0 
好的

我菜。我学习
2005-12-14 11:39
快速回复:求助啊
数据加载中...
 
   



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

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