<% id=request("id") Set conn=Server.CreateObject("ADODB.CONNECTION") connstr="Driver={Microsoft Access Driver (*.mdb)};dbq="&"D:/WEB/old/wwwapp/students.mdb" conn.open connstr sql="select * from faculty where ID="&id set rs=server.createobject("adodb.recordset") rs.open sql,conn,1,3 %> <%=rs("name")%>
<% function dispgen(key) cont=rs(key) pos=0 lent=len(cont) if cont<>"" then pos=instr(cont,chr(0)) if lent>pos then response.Write(mid(cont,pos+1)) end if end if end function function dispart() set qs=server.createobject("adodb.recordset") sql="select distinct year from paper where author="&id&" and year>0 order by year desc" qs.open sql,conn,1,1 response.Write("
    ") do while not qs.eof response.Write("
  • "&qs("year")&"
  • ") qs.movenext loop response.Write("
") qs.close set qs=nothing end function function dispcour() set qs=server.createobject("adodb.recordset") sql="select * from teach where teacher="&id&" order by dd" qs.open sql,conn,1,1 if qs.recordcount=0 then response.Write("(No Course)") else response.Write("
    ") do while not qs.eof if qs("hide")=1 then if qs("type")=0 then link=qs("link") else link="course.php?id="&qs("ID") end if response.write("
  • "&qs("course")&"
  • ") end if qs.movenext() loop response.Write("
") end if qs.close set qs=nothing end function function disp(key) cont=rs(key) pos=0 flag="f" lent=len(cont) if cont<>"" then flag=mid(cont,1,1) kind=mid(cont,2,1) pos=instr(cont,chr(0)) end if if flag="t" then if pos>3 then title=mid(cont,3,pos-3) else title="" end if response.Write("
") if kind="g" then dispgen key elseif kind="p" then dispart elseif kind="t" then dispcour end if response.Write("
") end if end function %>

<% if rs("rank")="prof" then%>Prof. <%end if%><%=rs("name")%>

<% disp "info"%> <% disp "edu"%> <% disp "exp"%> <% disp "intr"%> <% disp "proj"%> <% disp "pub"%> <% disp "other"%> <% disp "teach"%> <% disp "other1"%> <% disp "other2"%> <% disp "other3"%> <% disp "other4"%> <% rs.close set rs=nothing conn.close set conn=nothing %>

<%if session("key")=1 and session("id")-id=0 then%>Continue to edit my page<%else%>Edit my page<%end if%>