編集 OK、検索ボタンをクリックした後に移動するファイルであるファイルコードには、次のコードがあります。
<%
Dim DbConnectionStr
Dim objConn
Dim OrgRS, SQL
Dim StateRS, SQL1
TempOrganization = Request.Form("Organization")
TempState = Request.Form("State")
TempOrgType = Request.Form("OrgType")
TempLenderType = Trim(Request.Form("LenderType"))
TempAttributes = Request.Form("Attributes")
TempAreaServed = Request.Form("AreaServed")
'response.Write TempAreaServed
DbConnectionStr = Database Password Information....(Not listed, unimportant for you to help me with)
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open DbConnectionStr
SQL = "Select * FROM CDFILocator"
WhereFlag = False
DisplayFlag = False
DisplayCriteria = ""
If TempOrganization <> "ALL" then
SQL = SQL & " WHERE OrganizationName = '" & TempOrganization & "'"
DisplayCriteria = "Organization Name is <b>" & TempOrganization & "</b>"
WhereFlag = True
Else
DisplayCriteria = "Any Organization"
DisplayFlag = True
End If
If TempState <> "ALL" then
If WhereFlag = False then
SQL = SQL & " WHERE State = '" & TempState & "'"
DisplayCriteria = "State is <b>" & TempState & "</b>"
WhereFlag = True
Else
SQL = SQL & " and State = '" & TempState & "'"
DisplayCriteria = DisplayCriteria & " and State is <b>" & TempState & "</b>"
WhereFlag = True
End If
Else
If WhereFlag = False and DisplayFlag = False then
DisplayCriteria = "Any State"
DisplayFlag = True
Else
DisplayCriteria = DisplayCriteria & " and Any State"
End If
End If
If TempAreaServed <> "ALL" then
arrAreaServed = Split(TempAreaServed, ", ", -1, 1)
If WhereFlag = False then
SQL = SQL & " WHERE ("'" & TempAreaServed & "')"
DisplayCriteria = "Area(s) Served: "
For I = LBound(arrAreaServed) To UBound(arrAreaServed)
SQL = SQL & "AreaServed like '%" & arrAreaServed(I) & "%' or "
DisplayCriteria = DisplayCriteria & arrAreaServed(I) & ","
Next
DisplayCriteria = Mid(DisplayCriteria,1,Len(DisplayCriteria)-1)
' Add National for all
SQL = SQL & "AreaServed like '%national%' or "
SQL = Mid(SQL,1,Len(SQL)-3)
SQL = SQL & ")"
WhereFlag = True
Else
SQL = SQL & " AND ("'" & TempAreaServed & "')"
DisplayCriteria = DisplayCriteria & " and Area(s) Served: "
For I = LBound(arrAreaServed) To UBound(arrAreaServed)
SQL = SQL & "AreaServed like '%" & arrAreaServed(I) & "%' or "
DisplayCriteria = DisplayCriteria & arrAreaServed(I) & ","
Next
DisplayCriteria = Mid(DisplayCriteria,1,Len(DisplayCriteria)-1)
' Add National for all
SQL = SQL & "AreaServed like '%national%' or "
SQL = Mid(SQL,1,Len(SQL)-3)
SQL = SQL & ")"
WhereFlag = True
End If
Else
If WhereFlag = False and DisplayFlag = False then
DisplayCriteria = "Any Area Served in the Nation"
DisplayFlag = True
Else
DisplayCriteria = DisplayCriteria & " and Any Area Served in the Nation"
End If
End If
If TempOrgType <> "ALL" then
If WhereFlag = False then
SQL = SQL & " WHERE OrganizationType like '%" & TempOrgType & "%'"
DisplayCriteria = "Organization Type is <b>" & TempOrgType & "</b>"
WhereFlag = True
Else
SQL = SQL & " and OrganizationType like '%" & TempOrgType & "%'"
DisplayCriteria = DisplayCriteria & " and Organization Type is <b>" & TempOrgType & "</b>"
WhereFlag = True
End If
Else
If WhereFlag = False and DisplayFlag = False then
DisplayCriteria = "Any Organization Type"
DisplayFlag = True
Else
DisplayCriteria = DisplayCriteria & " and Any Organization Type"
End If
End If
If TempLenderType <> "ALL" then
If WhereFlag = False then
SQL = SQL & " WHERE LendingType like '%" & TempLenderType & "%'"
DisplayCriteria = "Lending Type is <b>" & TempLenderType & "</b>"
WhereFlag = True
Else
SQL = SQL & " and LendingType like '%" & TempLenderType & "%'"
DisplayCriteria = DisplayCriteria & " and Lending Type is <b>" & TempLenderType & "</b>"
WhereFlag = True
End If
Else
If WhereFlag = False and DisplayFlag = False then
DisplayCriteria = "Any Lender Type"
DisplayFlag = True
Else
DisplayCriteria = DisplayCriteria & " and Any Lender Type"
End If
End If
If TempAttributes <> "ALL" then
If WhereFlag = False then
SQL = SQL & " WHERE Attributes like '%" & TempAttributes & "%'"
DisplayCriteria = "Attributes are <b>" & TempAttributes & "</b>"
WhereFlag = True
Else
SQL = SQL & " and Attributes like '%" & TempAttributes & "%'"
DisplayCriteria = DisplayCriteria & " and Attributes are <b>" & TempAttributes & "</b>"
WhereFlag = True
End If
Else
If WhereFlag = False and DisplayFlag = False then
DisplayCriteria = "Any Attributes"
DisplayFlag = True
Else
DisplayCriteria = DisplayCriteria & " and Any Attributes"
End If
End If
SQL = SQL & " ORDER BY OrganizationName"
'Response.Write SQL
Set OrgRS = Server.CreateObject("ADODB.RecordSet")
OrgRS.Open SQL,objConn,adOpenKeySet,3
TempRecordCount = OrgRS.RecordCount
%>
<%
Dim strAryUrl
Dim strValue
Dim textSelection
strValue = Request.ServerVariables("URL")
strAryUrl = Split(strValue, "/")
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--[if lt IE 7 ]> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" class="no-js"> <!--<![endif]-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="keywords" content="Opportunity Finance Network, Mark Pinsky, community, development, community development, community development bank, community development fund, community development financial institution, community investment, affordable housing, urban renewal, loan fund, credit union, bank, banking, finance, financial, financing, funding, investing, loan, loans, microenterprise, venture capital, venture capital fund, CDFI, CDFIs, housing, business, small business, local business, community facilities, consumer financial services, socially responsible investing, socially responsible investment, community investing, revitalization, social justice, economic justice, economically-disadvantaged">
<link rel="stylesheet" href="/css/OFNStyles.css" type="text/css" />
<link rel="stylesheet" href="/css/navigation.css" type="text/css" />
<title>Opportunity Finance Network - Industry</title>
<script type="text/javascript" language="javascript" src="/inc/mainNavigation.js"></script>
<!--[if IE]>
<style type="text/css">
body{behavior:url(/css_hover.htc);}
#menu a, #menu h2{font:bold 0.7em/1.4em arial,helvetica,sans-serif;}
#menu ul li{float:left;height:1%;width:100%;}
#menu ul li a{height:1%;}
</style>
<![endif]-->
</head>
<body>
<table width="680" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#ffffff">
<tr>
<td valign="top" bgcolor="#072A60" height="24"></td>
</tr>
<tr>
<td>
<center>
<a href="/default.aspx"><img src="/images/ofnHeader.png" title="Home" width="680" height="71" border="0" alt="Opportunity Finance Network" /></a>
</center>
<!-- #INCLUDE virtual="/inc/mainNav.inc" -->
</td>
</tr>
<tr>
<td valign="top"><table width="680" border="0" cellspacing="0" cellpadding="0" id="mainTable">
<tr>
<td valign="top" id="leftNav" nowrap="nowrap">
<!-- #include file="subNav.inc" -->
<!-- #include virtual="/subNavPromos/subNavPromos.inc" -->
</td>
<td valign="top" id="mainCont" class="bodytxt">
<a style="float: right;text-decoration: underline;" href="/industry/industry_locator.asp">Search Again</a>
<style type="text/css">
.MPimgs { float: right; }
.MPlogo { text-align: right; float: right; }
.attribute { clear: right; float: right; margin-top: 5px; }
.MPdetails { line-height: 1.5; }
.ie6 .MPdetails,
.ie6 .MPimgs { float: right; }
.ie6 .MPdetails { width: 234px; }
.ie6 .MPimgs { width: 200px; }
.ie6 .attribute { clear: right; }
.ie6 hr { clear: right; }
</style>
<h1>Find a CDFI Results</h1>
<p><strong>Search Criteria</strong>: <%=DisplayCriteria%>.</p>
<% If Not OrgRS.EOF then
While not OrgRS.EOF %>
<h4><%=ORgRS("OrganizationName")%></h4>
<div class="MPimgs">
<% If Len(Trim(ORgRS("ImageFile"))) > 0 then %>
<img class="MPlogo" src="../images/members/<%=ORgRS("ImageFile")%>" border="0">
<% End If %>
<!-- Insert WNA Images here -->
<% If Instr(ORgRS("Attributes"), "CARS Rated") then %>
<br /><a href="http://www.carsratingsystem.net"><img class="attribute" src="../images/cars_rated.gif" alt="CARS™ Rated" border="0" /></a>
<% End If %>
<% If Instr(ORgRS("Attributes"), "10awardee") then %>
<br /><img class="attribute" src="../images/10awardee.png" alt="10 WNA Awardee" border="0" />
<% End If %>
<% If Instr(ORgRS("Attributes"), "10finalist") then %>
<br /><img class="attribute" src="../images/10finalist.png" alt="10 WNA Finalist" border="0" />
<% End If %>
<% If Instr(ORgRS("Attributes"), "10semi") then %>
<br /><img class="attribute" src="../images/10semi-finalist.png" alt="10 WNA SemiFinalist" border="0" />
<% End If %>
<% If Instr(ORgRS("Attributes"), "09awardee") then %>
<br /><img class="attribute" src="../images/09awardee.png" alt="09 WNA Awardee" border="0" />
<% End If %>
<% If Instr(ORgRS("Attributes"), "09finalist") then %>
<br /><img class="attribute" src="../images/09finalist.png" alt="09 WNA Finalist" border="0" />
<% End If %>
<% If Instr(ORgRS("Attributes"), "09semi") then %>
<br /><img class="attribute" src="../images/09semi-finalist.png" alt="09 WNA SemiFinalist" border="0" />
<% End If %>
<% If Instr(ORgRS("Attributes"), "08awardee") then %>
<br /><img class="attribute" src="../images/08awardee.png" alt="08 WNA Awardee" border="0" />
<% End If %>
<% If Instr(ORgRS("Attributes"), "08finalist") then %>
<br /><img class="attribute" src="../images/08finalist.png" alt="08 WNA Finalist" border="0" />
<% End If %>
<% If Instr(ORgRS("Attributes"), "08semi") then %>
<br /><img class="attribute" src="../images/08semi-finalist.png" alt="08 WNA Semifinalist" border="0" />
<% End If %>
<% If Instr(ORgRS("Attributes"), "07awardee") then %>
<br /><img class="attribute" src="../images/07awardee.png" alt="07 WNA Awardee" border="0" />
<% End If %>
<% If Instr(ORgRS("Attributes"), "07finalist") then %>
<br /><img class="attribute" src="../images/07finalist.png" alt="07 WNA Finalist" border="0" />
<% End If %>
<% If Instr(ORgRS("Attributes"), "07semi") then %>
<br /><img class="attribute" src="../images/07semi-finalist.png" alt="07 WNA Semifinalist" border="0" />
<% End If %>
<% If Len(Trim(ORgRS("MemberProfile"))) > 0 then %>
<br /><b><a class="attribute" href="../store/Downloads/<%=ORgRS("MemberProfile")%>" target="_blank"><img class="attribute" src="../images/mpDownload.png" alt="Download Member Profile" border="0" /></a></b>
<% End If %>
<% If Instr(ORgRS("Attributes"), "CJ4USA") then %>
<br /><img class="attribute" src="../images/cj4usaAwardee.png" alt="Create Jobs for USA Awardee" border="0" />
<% End If %>
</div> <!-- End MPimgs -->
<p class="MPdetails"><%=ORgRS("Address1")%><br />
<% If ORgRS("Address2") <> "" then %>
<%=ORgRS("Address2")%><br />
<% Else %>
<% End If %>
<%=ORgRS("City")%>, <%=ORgRS("State")%> <%=ORgRS("ZipCode")%> <br />
<b>Phone:</b> <%=ORgRS("Phone")%><br />
<b>Fax:</b> <%=ORgRS("Fax")%><br />
<b>E-Mail:</b> <a href="Mailto:<%=ORgRS("EMail")%>"><%=ORgRS("EMail")%></a><br />
<b>URL:</b> <a href="<%=ORgRS("URL")%>" target="_blank"><% If Len(Trim(ORgRS("URL"))) > 50 then %><%=Mid(ORgRS("URL"),1,50)%>...<% Else %><%=ORgRS("URL")%><% End If %></a><br />
<b>Contact Person:</b> <%=ORgRS("ContactPerson")%>, <%=ORgRS("Title")%><br />
<b>Area Served:</b> <%=ORgRS("AreaServed")%><br />
<b>Organization Type:</b> <%=ORgRS("OrganizationType")%><br />
<b>Lending Type:</b> <%=ORgRS("LendingType")%></p>
<p><%=ORgRS("Description")%></p>
<hr color="Black" width="50%" Align="center">
<% OrgRS.MoveNext
Wend
%>
<p class="bodytxt" style="float: right;"><a href="/industry/industry_locator.asp">Search Again</a></p>
<%
Else
%>
<p class="bodytxt">No results found from your search criteria.</p>
<p class="bodytxt"><a href="/industry/industry_locator.asp">Search Again</a></p>
<% End If %>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td id="footCell">
<!-- #INCLUDE virtual="/inc/footer.inc" -->
<!-- Start Google Analytics Code -->
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-965748-1";
urchinTracker();
</script>
<!-- End Google Analytics Code --></body>
</html>
<% OrgRS.Close
Set OrgRS = nothing
objConn.Close
Set objConn = nothing
%>
これ以上コードが必要な場合はお知らせください。私がする必要があるのは、何とかURLに基づいてデータベースから情報を取得することです...