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

📄 moduser.asp

📁 这是一个通讯录
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%@ Language=VBScript %>
<% option explicit%>
<!--#include file="adovbs.asp"-->
<!--#include file="conn.asp"  -->
<%
Dim USERID
Dim strSQL
Dim List,action
Dim name,password,sex,mail,url,icq_img,icqnum,age
Dim years,mons,days,likes,address,photo,doc,mode
Dim ip,counter,n,y,r,s,f,m,sj,times,xingzuo
USERID=Request.Querystring("USERID")
IF Session("username")="" or Session("password")="" or USERID="" Then
Session("username")=""
Session("Password")=""
UserID=""
response.write "<script language='javascript'>" & chr(13)
response.write "alert('用户信息丢失,请重新登陆!');" & Chr(13)
response.write "window.document.location.href='userre.asp';"&Chr(13)
response.write "</script>" & Chr(13)
End if

strSQL="SELECT * FROM List WHERE"
   strSQL = strSQL & " name LIKE '%" & Session("username") & "%'"
   strSQL = strSQL & " and password LIKE '%" & Session("password") & "%'"
   strSQL = strSQL & " and ID LIKE '%" & USERID & "%'"
strSQL =strSQL & " Order by ID DESC" 

set list=server.createobject("adodb.recordset")
list.open strSQL,conntmp,adOpenKeySet,adLockPessimistic
'数据错误处理
if list.eof and list.bof then
Session("username")=""
Session("Password")=""
UserID=""
 Response.WRite "错误!没有当前用户!请重新登陆!"
 Response.End
End if

IF  Session("Username")<>list("name") and Session("password")<>list("password") and USERID<>list("id") Then             '如果用户名称等于NULL则证明没有通过验证
Session("username")=""
Session("Password")=""
UserID=""
response.write "<script language='javascript'>" & chr(13)
response.write "alert('没有登陆,请重新登陆!');" & Chr(13)
response.write "window.document.location.href='userre.asp';"&Chr(13)
response.write "</script>" & Chr(13)
End if
Response.Write "OK!通过确认了..."                        '确认用户已经通过确认!
Response.Write Session("Username")

action = Request.Querystring("action")
If action="xiu" Then
Response.Write "修改记录"
name     = trim(Request.Form("name"))      '姓名
password = trim(Request.Form("password"))  '密码
sex      = trim(Request.Form("sex"))       '性别
mail     = trim(Request.Form("mail"))      'E-Mail
URL      = trim(Request.Form("URL"))       '网站链接
icq_img  = trim(Request.Form("icq_img"))   '传呼机图片
icqnum   = trim(Request.Form("icqnum"))    '传呼机号码
AGE      = trim(Request.Form("age"))       '年龄
years    = trim(Request.Form("years"))     '生日的年
mons     = trim(Request.Form("mons"))      '生日的月
days     = trim(Request.Form("days"))      '生日的日
likes    = trim(Request.Form("likes"))     '爱好
address  = trim(Request.Form("address"))   '居住地
photo    = trim(Request.Form("photo"))     '相片
doc      = trim(Request.Form("doc"))       '留言
mode     = trim(Request.Form("mode"))      '交友方式
ip       = Request.ServerVariables("REMOTE_ADDR")        '使用ServerVariables读取用户的IP地址,将用户IP放如IP变量中
counter  = "0"
n=Year(date())                                           '取得函数Year年的年份放入n的变量中
y=Month(date())                                          '取的函数Month月的月份放入y的变量中
r=Day(date())                                            '取的函数Day天的天数放入r的变量中
s=Hour(time())                                           '取得函数Hour小时的小时数放入s变量中
f=Minute(time())                                         '取的函数Minute分的分钟数值放入f变量中
m=Second(time())                                         '取的函数Second秒的秒数放入m变量中
if len(y)=1 then y="0" & y                               '如果y的数值等于一位数的话,则y等于0+Y变量,也就是说,把单数前都加一个0,比如01 or 02 or 03
if len(r)=1 then r="0" & r
if len(s)=1 then s="0" & s
if len(f)=1 then f="0" & f
if len(m)=1 then m="0" & m
sj=n & "年" & y & "月" & r & "日" & " " & weekdayname(weekday(date())) & " " & s & ":" & f & ":" & m
                                                         'sj 等于 X年X月X日空格 星期几 几点几分几秒
                                                         'WeekDay是提供一个1与7之间的数值,也就是星期几
times    = sj
'#####################星座判断#########################
set list=server.createobject("ADODB.RECORDSET")
list.open strSQL,conntmp,3,2
list("name")=name
list("password")=password
list("sex")=sex
list("mail")=mail
list("url")=url
list("icqnum")=icqnum
list("icq_img")=icq_img
age=n-years
list("age")=age       '年龄需要根据生日修改,而且需要制作星座代码
list("years")=years
list("mons")=mons
list("days")=days
list("likes")=likes
list("address")=address
'list("photo")=photo
list("doc")=doc
list("mode")=mode
list("ip")=ip
list("times")=times
list.update
%>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>个人信息</title><style>
<!--
#tipBox {position: absolute; 
           width: 160px; 
           z-index: 100;
           border: 1pt black solid;
           font-family:宋体;
           font-size: 9pt;
           background: ffffdf; 
           visibility: hidden}
a:link {color:#000000;text-decoration: none}
a:visited {color:#000000;text-decoration: none}
a:active {color:#000000;text-decoration: none}
a:hover {color:red;text-decoration: none}
-->
</style>
</head>

<body>
<div align="center">
  <center>
  <table border="1" width="600" cellspacing="0" cellpadding="3" bgcolor="#998CD2" bordercolor="#988CD8">
    <tr>
      <td width="100%">
        <p align="center">您的信息</td>
    </tr>
  </table>
  </center>
</div>
<div align="center">
  <center>
<table border="1" width="600" bgcolor="#F8EBD1" cellspacing="0" cellpadding="3" bordercolor="#988CD8" style="font-family: 宋体; font-size: 9pt" bordercolorlight="#000000" bordercolordark="#FFFFFF">
  <tr>
        <td width="66" align="center"><a href=index.asp?action=search>⊙-朋友列表</a></td>
    <td width="66" align="center"><a href="add.asp">⊙-朋友加入</a></td>
    <td width="66" align="center"><a href="userre.asp">⊙-修改资料</a></td>
    <td width="66" align="center"><a href="sf.asp?Keys=Login">⊙-管理入口</a></td>
    <td width="66" align="center"><a href="admsearch.asp?keys=admsearch">⊙-高级搜索</a></td>
        <td width="220" align="center"><font color="#996600">现有</font><font color="#FF6600"> 
          <!--#include file="zongshu.asp" --> </font><font color="#996600">位朋友加入</font></td>
  </tr>
</table>
  </center>
</div>
<div align="center">
  <center>
  <table border="1" width="600" cellspacing="0" style="font-family: 宋体; font-size: 9pt" cellpadding="3" bordercolor="#988CD0" height="272">
    <tr>
      <td width="590" bgcolor="#988CD0" colspan="2" height="12">这是您的修改的结果</td>
    </tr>
   <!-- <tr>
      <td width="590" colspan="2" bgcolor="#EEF1F7" height="12">photo...</td>
    </tr> -->
    <tr>
      <td width="149" align="right" bgcolor="#CCCCFF" height="12">姓名:</td>
      <td width="433" height="12"><%=list("name")%></td>
    </tr>
    <tr>
      <td width="149" align="right" bgcolor="#CCCCFF" height="12">性别:</td>
      <td width="433" height="12"><%=list("sex")%></td>
    </tr>
    <tr>
      <td width="149" align="right" bgcolor="#CCCCFF" height="12">信箱:</td>
      <td width="433" height="12"><%=list("mail")%></td>
    </tr>
    <tr>
      <td width="149" align="right" bgcolor="#CCCCFF" height="12">联系方法:</td>
      <td width="433" height="12"><img src=<%=list("icq_img")%>  border="0"><%=list("icqnum")%></td>
    </tr>
    <tr>
      <td width="149" align="right" bgcolor="#CCCCFF" height="12">生日:</td>
      <td width="433" height="12"><%=years%>年<%=mons%>月<%=days%>日</td>
    </tr>
    <tr>
        <td width="149" align="right" bgcolor="#CCCCFF" height="12">联系电话:</td>
      <td width="433" height="12"><%=xingzuo%></td>
    </tr>
    <tr>
        <td width="149" align="right" bgcolor="#CCCCFF" height="12">联系地址:</td>
      <td width="433" height="12"><%=likes%></td>
    </tr>
    <tr>
      <td width="149" align="right" bgcolor="#CCCCFF" height="11">联系地址:</td>
      <td width="433" height="11"><%=address%></td>
    </tr>

⌨️ 快捷键说明

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