如何实现通过用户名访问用户页面?

shfengyi 2008-11-30 02:11:31
类似于blog的功能,例如:
网站:www.abc.com
用户名:king
用户id:123
如何实现用 www.abc.com/user/king 的形式访问用户页面,
而不是通过 www.abc.com/user/user.asp?user_id=123的形式
...全文
145 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
phyllis2001 2009-07-30
  • 打赏
  • 举报
回复
url rewrite
elsu2000 2009-07-29
  • 打赏
  • 举报
回复
设置记录集,提取数据库用户名字段=阶段变量
rivertrue 2009-07-29
  • 打赏
  • 举报
回复
ISAPI_Rewrite
elsu2000 2009-07-29
  • 打赏
  • 举报
回复
变量传递
liuwei_IT_love 2009-07-28
  • 打赏
  • 举报
回复
在我的主页最上方加入:
<%
if session("username")<>""then
username=session("username")
user_type=session("user_type")
str="select * from user where user_name='"&username&"' order by user_id desc"
set rs=db.execute(str)
%>


<table>
<tr>
<td>
用户名:<%=rs("user_name")%>
</td>
</tr>
<tr>
<td>
ID:<%=rs("user_id")%>
</td>
</tr>

</table>


<%
else
response.write"对不起,您还没有登录!!"
end if
%>
liuwei_IT_love 2009-07-28
  • 打赏
  • 举报
回复
处理用户登录:
<%
dim username,password,str,rs
username=request.Form("username")
password=request.Form("password")
str="select * from user where user_name='"&username&"' order by user_id desc"
set rs=db.execute(str)
if rs("user_password")= password then
session("username")=request("username")
'if then
response.Redirect"例如myindex.asp"
'end if
else
response.Write "<font size='-1'>"&"对不起,用户名或密码不正确!!!!"&"</font>"
response.Write "<a href='index.asp'>"&"返回"&"</a>"
end if
%>




longmm810 2008-11-30
  • 打赏
  • 举报
回复
我来关注下
shfengyi 2008-11-30
  • 打赏
  • 举报
回复
??? 无人关注?

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧