我試圖將這些函數從.asp文件轉換或轉換成.php函數,因爲我還不熟悉.asp。 其中一些我認識並可以理解,如SQL命令和遠程表中的數據將去的佔位符,其餘的都讓我感到困惑。 我已經轉換了一些如我認爲相當於PHP的include的include,';功能和其他幾個。有兩種語言的工作知識的人能告訴我哪些功能在哪裏?將asp函數轉換爲php
<!--#include virtual="/includes/functions.asp" -->
<%
intBusiness_Catagory = Request("select_catagory")
Set thisConn = Server.CreateObject("ADODB.Connection")
thisConn.Open CreateAfccDSN()
SelectSQL = "SELECT * FROM BusinessInfo WHERE ((CatID = " & intBusiness_Catagory & ") or (CatID2 = " & intBusiness_Catagory & ") or (CatID3 = " & intBusiness_Catagory & ")) and (intStatusCodeID = 1) and (intOnWeb = 1) Order By vcBusinessName"
Set SelectRs = thisConn.Execute(SelectSQL)
If SelectRs.EOF Then
Response.Write("No members found for selected category.<br> Please search <a href='javascript:history.back()'>again</a>.")
Else
%>
<b>Member Search Results:</b>
<p>
<%
End If
If Not SelectRs.BOF AND Not SelectRs.EOF then
SelectRs.MoveFirst
Do Until SelectRs.EOF
%>
<b><%=SelectRs("vcBusinessName") %></b><br>
<%=SelectRs("vcPhone") %><br>
<%=SelectRs("vcPAddress") %><br>
<%=SelectRs("vcPCity") %>, <%=SelectRs("vcPState") %> <%=SelectRs("vcPZipCode") %><br>
<%
If isNull(SelectRs("vcURL")) then
Else
%>
<b>Website: </b><a href="http://<%=SelectRs("vcURL") %>" target="_blank"><%=SelectRs("vcURL") %></a>
<%
End If
%>
<p>
<hr>
<%
SelectRs.MoveNext
Loop
%>
<%
End If
SelectRs.Close
Set SelectRs = Nothing
%>
沒有人會重新寫你對你的代碼。你不瞭解ASP代碼的哪些部分? – 2012-02-02 19:55:36
主要是if語句,Rewrite語句,Set thisConn = Server.CreateObject,thisConn.Open,CreateAfccDSN()和intBusiness_Catagory。 – Tower 2012-02-02 20:05:42