<%@ LANGUAGE="VBSCRIPT" %>
<%option explicit
response.buffer=true
%>
<!--#include file="linkconn.asp"-->
<%
function htmlencode2(str)
    dim result
    dim l
    if isNULL(str) then 
       htmlencode2=""
       exit function
    end if
    l=len(str)
    result=""
	dim i
	for i = 1 to l
      select case mid(str,i,1)
	           case "<"
	                result=result+"&lt;"
	           case ">"
	                result=result+"&gt;"
              case chr(34)
	                result=result+"&quot;"
	           case "&"
	                result=result+"&amp;"
	           case else
	                result=result+mid(str,i,1)
         end select
       next 
       htmlencode2=result
   end function

   dim cmdTemp
       dim InsertCursor
       Set cmdTemp = Server.CreateObject("ADODB.Command")
       Set InsertCursor = Server.CreateObject("ADODB.Recordset")
       cmdTemp.CommandText = "SELECT * FROM AddLink"
       cmdTemp.CommandType = 1
       Set cmdTemp.ActiveConnection = conn
       InsertCursor.Open cmdTemp, , 1, 3
       InsertCursor.addnew 
       InsertCursor("username") =htmlencode2(Request.Form("userName"))
       InsertCursor("webname") =htmlencode2(Request.Form("TxtName"))
       InsertCursor("email") =htmlencode2(Request.Form("TxtEmail"))
       InsertCursor("homepage") =htmlencode2(Request.Form("TxtHomepage"))
       InsertCursor("Note") =htmlencode2(Request.Form("note"))
       InsertCursor("time") =cstr(now())
       InsertCursor.Update
       InsertCursor.close
       conn.close
       set InsertCursor=nothing
       set conn=nothing
       response.redirect "index.asp"
%>
