The program that displays the source code of ASP and PHP program is collected on the net. I do not know whether to join the elite area.

Source: Internet
Author: User
Tags join
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



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.