Jag har en sida som först ser ut så här
% If Request.Querystring("action") = "0" Then %>
<!--#include file="code/dist0.code"-->
<% ElseIf Request.Querystring("action") = "1" Then %>
<!--#include file="code/dist1.code"-->
<% ElseIf Request.Querystring("action") = "2" Then %>
<!--#include file="code/dist2.code"-->
<% End If %>
sen ser .code filerna ut så tex så här
<%
Response.Write"<table width='600' border='0'><tr><td width='25'></td><td width='585' class='txtmain'><table cellpadding='0' cellspacing='0' border='0' width='500'><tr class='txtmain'><td>"
Set Connect = Server.CreateObject("ADODB.Connection")
Connect.Open "driver={Microsoft Access Driver (*.mdb)};dbq=c:\inetpub\wwwroot\db\customer00.mdb"
'SÄTTER VÄRDET FRÅN FORMULÄRKNAPPARNA TILL EN COOKIE SAMMLING
Response.Cookies("koll")("a1") = request.form("a1")
Response.Cookies("koll")("a2") = request.form("a2")
Response.Cookies("koll")("a3") = request.form("a3")
Response.Cookies("koll")("a4") = request.form("a4")
Response.Cookies("checkflagg") = "False"
if request.cookies("koll")("a1") > "" Then
IntAutomation = "1"
Response.Cookies("checkflagg") = "True"
a1 = true
End If
If request.cookies("koll")("a2") > "" Then
IntConveying = "2"
Response.Cookies("checkflagg") = "True"
a2 = true
End If
If request.cookies("koll")("a3") > "" Then
IntGap = "3"
Response.Cookies("checkflagg") = "True"
a3 = true
End If
If request.cookies("koll")("a4") > "" Then
IntLabVac = "4"
Response.Cookies("checkflagg") = "True"
a4 = true
End If
'KOLLA OM MAN VALDE NÅGOT ÖVER HUVUD TAGET
If Request.Cookies("checkflagg") = "False" Then
Response.Write"Du valde inte någon produkt grupp"
Connect.Close
End If
StrSQL = "Select CountryRep.CountryRepENG, d1.CustomerType, D1.Automation, D1.Transport, d1.Labvacs, d1.GAP FROM D1 INNER JOIN CountryRep On D1.CustomerID = CountryRep.CustomerID GROUP BY CountryRep.CountryRepENG, d1.Companyname, d1.Customertype, d1.automation, d1.transport, d1.Labvacs, d1.gap HAVING "
StrSQLAutomation = "d1.Automation='"
StrSQLConveying = "d1.Transport='"
StrSQLGap = "d1.Gap='"
StrSQLLabVacs ="d1.Labvacs='"
StrSQLClose = "' Order By CountryREP.CountryRepENG"
StrSQLAnd = "' OR "
If a1 = true Then
StrSQL = StrSQL & StrSQLAutomation & IntAutomation
If a2= true Or a3 = true Or a4 = true Then
StrSQL = StrSQL & StrSQLAnd
End If
End If
If a2 = true Then
StrSQL = StrSQL & StrSQLConveying & IntConveying
If a3 = true Or a4 = true Then
StrSQL = StrSQL & StrSQLAnd
End If
End If
If a3 = true Then
StrSQL = StrSQL & StrSQLGap & IntGap
If a4 = true Then
StrSQL = StrSQL & StrSQLAnd
End If
End If
If a4 = true Then
StrSQL = StrSQL & StrSQLLabVacs & IntLabVac
End If
StrSQL = StrSQL & StrSQLClose
Prevcountry = "nothing"
Set RS = Connect.Execute(StrSQL)
Response.Write"<span class='P_header1'>Distributors</span><br>"
Response.Write"Selected Product group(s):<br>"
If Request.Cookies("koll" & a1).Haskeys = FALSE Then
Response.Write"-Pumps, Suction Cups, Logics<br>"
End If
If Request.Cookies("koll" & a2).Haskeys = FALSE Then
Response.Write"-Vacuum Conveying<br>"
End If
If Request.Cookies("koll" & a3).Haskeys = FALSE Then
Response.Write"-Graphic Air Pumps<br>"
End If
If Request.Cookies("koll" & a4).Haskeys = FALSE Then
Response.Write"-Lab Vacs<br>"
End If
Response.Write"<br><br>The product group(s) you have selected have distributors in the following countries:<br>"
response.write"<table width='500' border='0' cellspacing='0' cellpadding='0'><tr><td width='128' valign='middle'><FORM method='post' action='distributors.asp?action=2'><SELECT Name='StrCountry' class='txtbox'>"
While NOT RS.EOF
If prevCountry <> rs("CountryRepENG") Then
Response.Write"<option>"
Response.Write rs("CountryRepENG")
Response.Write"</option>"'
PrevCountry = RS("CountryRepENG")
RS.MoveNext
Else
Rs.MoveNext
End If
Wend
RS.Close
Connect.Close
Response.Write"</select></td><td width='372' valign='middle'><br><input src='images/cmd_go.gif' name='skicka' border='0' type='image'></form></td></tr></table></tr></table></td></tr></table>"
%>
Jag läste någon stanns att han går igenom alla include filer redan när man gör if / querystring sattsen. Om det är så borde ju ett sådant här sett att gå tillväga ta mer kräm än om man delat upp den på 3 filer ? har jag rätt eller helt fel ?
tacksam
------------------
1 Man, 1 Million dead, The odds are just about even - Ash
[Redigerat av erka den 15 feb 2001]