<!--#include file="conn.asp" -->
<!--#include file="inc/char.inc" -->
<!--#include file="top2.asp" -->
<%
response.buffer=true
dim errmsg,founderr,username,homepage,url,image,password,e_mail,oicq,message

url=trim(replace(request("url"),"'",""))
password=trim(replace(request("password"),"'",""))


call chkinput
call chkuser
if founderr=true then 
	call error() 
else 
	call reginfo()
end if

sub chkinput()
	if chkpost=false then
   		ErrMsg=ErrMsg+"<Br>"+"<li>您提交的数据不合法，请不要从外部提交发言。"
   		FoundErr=True
	end if

	if len(url) > 40 then
		errmsg=errmsg+"<br>"+"<li>请输入您的网址过长！"
		founderr=true
	else
		url=url
	end if
	
	if Instr(request("url"),"=")>0 or Instr(request("url"),"%")>0 or Instr(request("url"),chr(32))>0 or Instr(request("url"),"?")>0 or Instr(request("url"),"&")>0 or Instr(request("url"),";")>0 or Instr(request("url"),",")>0 or Instr(request("url"),"'")>0 or Instr(request("url"),",")>0 or Instr(request("url"),chr(34))>0 or Instr(request("url"),chr(9))>0 or Instr(request("url"),"")>0 then
	errmsg=errmsg+"<br>"+"<li>网址中含有非法字符。"
		founderr=true
	else
		url=trim(request("url"))
	end if
	
		if password="" or len(password) > 20 then
		errmsg=errmsg+"<br>"+"<li>请输入您的密码过长！"
		founderr=true
	else
		password=trim(request("password"))
	end if
end sub


sub chkuser
	sql = "Select * From link Where url='"&url&"' And password='"&Password&"'"	
	set rs=server.createobject("adodb.recordset")

	rs.open sql,conn,1,3
	If rs.EOF Then
		errmsg=errmsg+"<br>"+"<li>网址和密码不正确 !"
		founderr=true
		call error()
		response.end
	end if	
	username=rs("username")
	homepage=rs("homepage")
	image=rs("image")
	password=rs("password")
	e_mail=rs("e_mail")
	oicq=rs("oicq")
	message=rs("message")	
	
	
	Rs.Close	
	Set Rs=Nothing	
	
end sub


sub reginfo()
call top2()
%>
<form method="post" action="edit3.asp" name="edit">
<br><br><br>
<table border=1 cellpadding=5 cellspacing=0
width="501" align="center" bordercolor="#0099cc">
  <tr> 
    <td align=middle class=td
width=483 height="32" colspan="2"> 
      <p align="center"><b><%=username%> 的信息</b></p>
    </td>
  </tr>
  <tr> 
    <td width=30% class=td1  align="right">网站名称：</td>
    <td class=td2 width=70%> 
      <input type=text name=homepage size=20 maxlength=20 value="<%=homepage%>" >
      <font color="#FF3333">*</font> 字母或数字</td>
  </tr>
  <tr> 
    <td width=30% class=td1  align="right">网站地址：</td>
    <td class=td2 width=70%> 
      <input type=text name=url size=30 maxlength=30  value="<%=url%>">
      <font color="#FF3333">*</font> </td>
  </tr>
  <tr> 
    <td width=30% class=td1  align="right">网站图标：</td>
    <td class=td2 width=70%> 
      <input type=text name=image size=40 maxlength=40  value="<%if image ="none" then response.write "" else response.write image end if%>">
      88*31 </td>
  </tr>
  <tr> 
    <td width=30% class=td1  align="right" height="38">站长名称：</td>
    <td class=td2 width=70% height="38"> 
      <input type=text name=username size=20 maxlength=20 value="<%=username%>" >
      <font color="#FF3333">*</font> </td>
  </tr>
  <tr> 
    <td width=30% class=td1  align="right">站长密码：</td>
    <td class=td2 width=70%> 
      <input type="password" name="password" size="20" maxlength="20" value="<%=password%>">
      <font color="#FF3333">*</font> 字母或数字</td>
  </tr>
  <tr> 
    <td width=30% class=td1  align="right">站长信箱：</td>
    <td class=td2 width=70%> 
      <input type="text" name="e_mail" size="20" maxlength="20" value="<%=e_mail%>">
      <font color="#FF3333">*</font> </td>
  </tr>
  <tr> 
    <td width=30% class=td1  align="right">oicq：</td>
    <td class=td2 width=70%> 
      <input type="text" name="oicq" size="20" maxlength="20" value="<%if oicq=0 then response.write "" else response.write oicq end if%>">
    </td>
  </tr>
  <tr> 
      <td width=30% class=td1  align="right">网站类别：</td>
      <td class=td2 width=70%> 
        <select name="typeid" size="1">
          <%
dim rs,sql,sel
set rs=server.createobject("adodb.recordset")
sql="select * from linktype"
rs.open sql,conn,1,1
	do while not rs.eof        
	response.write "<option" & " value='"+CStr(rs("typeID"))+"' name=typeid>"+rs("type")+"</option><br>"
	rs.movenext
    	loop
rs.close
set rs = nothing
conn.close
set conn=nothing
			  %> 
        </select>
        <font color="#FF3333">*</font> </td>
    </tr>
    <tr> 
    <td width=30% class=td1  align="right">网站说明：</td>
    <td class=td2 width=70%> 
      <textarea name="message" cols="40" wrap="VIRTUAL" rows="3"><%=message%></textarea>
      <font color="#FF3333">*</font> </td>
  </tr>
  <tr> 
    <td colspan="2" class=td  align="right"> 
      <div align="center"><input type="submit" value="现在更改！" name="submit3"></div>
    </td>
  </tr>
</table>
</form>
<!--#include file="foot.inc" -->
<%
end sub 
'==========================================
'程序制做:迅捷网络.    http://www.soonhost.com
'迅捷主机网 -- 域名注册、主机租用、网站建设、脚本开发
'网址：http://www.soonhost.com
'msn:soonhost@hotmail.com
'请保留以上版权信息，谢谢合作！
'==========================================
%>