Solve | sort | problem: add_massege.asp
------------part, without optimal finishing------------
<body bgcolor= "#C8C8E6" >
<script language= "VBScript" >
Sub GoBack ()
Form1.btn1.value= "Back"
History.go (-1)
End Sub
</Script>
<%
Name1=session ("Uname")
If name1= "" Then
Response.Write "<font size=3 color=blue><center>"
Response.Write "<br>"
Response.Write "<br>"
Response.Write "Only members can use this feature, please register or login!" <p> "
Response.Write "<a href=main1.htm> back on page </a>"
Response.End
End If
Psw1=session ("UPSW")
Orderid=request ("Txtorderid")
Face=request ("R1")
Level=request ("Txtlevel")
Name=request ("Txtname")
Psw=request ("TXTPSW")
Work=session ("Uwork")
Add=session ("Uadd")
Eee=session ("Unid")
Mail=request ("Txtmail")
Subject=request ("Txtsubject")
Ip=request.servervariables ("REMOTE_ADDR")
If name = "" OR PSW = "" Then
Response.Write "<font size=5 color=blue><center>"
Response.Write "<br>"
Response.Write "<br>"
Response.Write "Please fill in your name/password ~ <p>"
%>
<form name=form1>
<input type= "button" Name= "Btn1" value= "return" onclick= "GoBack" >
</form>
<%
Response.End
End If
If name<>name1 Or PSW<>PSW1 Then
Response.Write "<font size=5 color=blue><center>"
Response.Write "<br>"
Response.Write "<br>"
Response.Write "Your name/password has errors, please carefully fill in!" ~ <p> "
%>
<form name=form1>
<input type= "button" Name= "Btn1" value= "return" onclick= "GoBack" >
</form>
<%
Response.End
End If
If subject= "" Then
Response.Write "<font size=5 color=blue><center>"
Response.Write "<br>"
Response.Write "<br>"
Response.Write "Please fill in your speech theme ~ <p>"
%>
<form name=form1>
<input type= "button" Name= "Btn1" value= "return" onclick= "GoBack" >
</form>
<%
Response.End
End If
IF orderid<> "" Then
J=len (OrderID)
Mmm=left (orderid,j-1)
Set conn = Server.CreateObject ("ADODB. Connection ")
Dbpath=server.mappath (".. /fpdb/massege.mdb ")
Conn. Open "Driver={microsoft Access Driver (*.mdb)};d bq=" & DBPath
Set RS = conn. Execute ("Select A_id,a_orderid from Massege")
Do but not RS. Eof
Nnn=rs ("A_orderid")
If Left (nnn,j-1) =mmm Then
AAA=ASC (Mid (nnn,j,1))
If aaa=122 Then
qqq=mmm+ "a" + "Z"
Else
QQQ=MMM+CHR (aaa+1) + "Z"
End If
End If
Rs. MoveNext
Loop
Rs. Close
Conn. Close
Else
Set myconn = Server.CreateObject ("ADODB. Connection ")
Dbpath=server.mappath (".. /fpdb/massege.mdb ")
MyConn. Open "Driver={microsoft Access Driver (*.mdb)};d bq=" & DBPath
Sqlcmd1= "SELECT * from massege Where a_level = ' 0 ' ORDER by a_id DESC"
Set RS = myconn. Execute (SQLCMD1)
Nnn=rs ("A_orderid")
A=ASC (Left (nnn,1))
B=ASC (Mid (nnn,2,1))
C=ASC (Mid (nnn,3,1))
D=ASC (Mid (nnn,4,1))
E=ASC (Mid (nnn,5,1))
F=ASC (Mid (nnn,6,1))
%>
<%=CHR (a)%>11<%=chr (b)%>22<%=CHR (c)%>33<%=CHR (d)%>44<%=chr (e)%>55<%=chr (f) >66
<%
If f<122 Then
QQQ=CHR (a) +chr (b) +CHR (c) +CHR (d) +chr (e) +chr (f+1) + "Z"
%>
<%=qqq%>77
<%
Else
If e<122 Then
QQQ=CHR (a) +chr (b) +CHR (c) +CHR (d) +chr (e+1) + "AZ"
%>
<%=qqq%>88
<%
Else
If d<122 Then
QQQ=CHR (a) +chr (b) +CHR (c) +CHR (d+1) + "Aaz"
%>
<%=qqq%>99
<%
End If
End If
End If
Rs. Close
MyConn. Close
End If
Text=server.htmlencode (Request ("Txttext"))
%>
<%=text%>
<%on Error Resume Next
Set conn = Server.CreateObject ("ADODB. Connection ")
Dbpath=server.mappath (".. /fpdb/massege.mdb ")
Con