Program | essence | show | source code REM view_code.asp
<%
On Error Resume Next
%>
<%
function Rt_min (num1,num2)
If Num1=0 and num2=0 then
Rt_min=-1
ElseIf Num1=0 Then
Rt_min=num2
ElseIf Num2=0 Then
Rt_min=num1
ElseIf Num1<num2 Then
Rt_min=num1
Else
Rt_min=num2
End If
End Function
%>
<%
function Line_check (strline,cgi_type)
Dim Cgi_flag
If cgi_type= "PHP" Then
Cgi_flag= "?"
Else
cgi_flag= "%"
End If
Line_check=0
Itemp=0
Ipos=instr (strline, "<" &cgi_flag)
If Rt_min (ipos,itemp) =ipos Then
Itemp=ipos
Line_check=1
End If
Ipos=instr (strline,cgi_flag& ">")
If Rt_min (ipos,itemp) =ipos Then
Itemp=ipos
line_check=2
End If
Ipos=instr (1,strline, "<" & "script", 1)
If Rt_min (ipos,itemp) =ipos Then
Itemp=ipos
Line_check=3
End If
Ipos=instr (1,strline, "<" & "/script", 1)
If Rt_min (ipos,itemp) =ipos Then
Itemp=ipos
Line_check=4
End If
End Function
%>
<%
Sub Printhtml (strline)
Ispace=len (strline)-len (LTrim (strline))
I=1
while (Mid (strline,i,1)) =CHR (9)
Ispace=ispace+5
I=i+1
Wend
If Ispace>0 Then
For I=1 to Ispace
Response.Write ("")
Next
End If
Ipos=instr (strline, "<")
If IPOs then
Response.Write (Left (strline,ipos-1))
Response.Write ("<")
Strline=right (Strline,len (strline)-ipos)
Call Printhtml (strline)
Else
Response.Write (strline)
End If
End Sub
%>
<%
Sub PrintLine (Strline,iflag,cgi_type)
Dim Cgi_flag
If cgi_type= "PHP" Then
Cgi_flag= "?"
Else
cgi_flag= "%"
End If
Select Case Iflag
Case 0
Call Printhtml (strline)
Case 1
Ipos=instr (strline, "<" &cgi_flag)
Call Printhtml (Left (strline,ipos-1))
Response.Write ("<font color= #ff0000 >")
Response.Write ("<" &cgi_flag)
Strline=right (Strline,len (strline)-ipos-1)
Call PrintLine (Strline,line_check (Strline,cgi_type), Cgi_type)
Case 2
Ipos=instr (strline,cgi_flag& ">")
Call Printhtml (Left (strline,ipos-1))
Response.Write (cgi_flag& ">")
Response.Write ("</font>")
Strline=right (Strline,len (strline)-ipos-1)
Call PrintLine (Strline,line_check (Strline,cgi_type), Cgi_type)
Case 3
Ipos=instr (1,strline, "<" & "script", 1)
Call Printhtml (Left (strline,ipos-1))
Response.Write ("<font color= #00ff00 >")
Respons