=?Utf-8?B?QXRobWF1cw==?= wrote on 03 sep 2006 in
microsoft.public.inetserver.asp.general:
Quote:
Quote:
If Request.Form("licenses") = one AND prod2 = "on" AND prod3 = "on"
Then
Response.Redirect "http://www.msn.com"
Else
If Request.Form("licenses") = one AND prod3 = "on" Then
Response.Redirect "http://www.dogpile.com"
Else
If Request.Form("licenses") = one AND prod2 = "on" Then
Response.Redirect "http://www.google.com"
Else
| |
the above is included in the below if clause,
because they both goto Google!
Quote:
Quote:
If Request.Form("licenses") = one Then
Response.Redirect "http://www.google.com"
Else
Response.Redirect "http://ps2.ign.com"
CrossSale
End If
End If
End If
End If
| |
[please do not toppost on usenet]
Quote:
yeah the javascript is 100% working and i got the aps works now as i
replaced the "on" with "true" I just wish i could streamline the code
some more
|
A lot of streamlining cn be done to the above:
vbs hase "elseif":
If Request.Form("licenses") = one AND prod2 = "true"_
AND prod3 = "true" Then
Response.Redirect "http://www.msn.com"
ElseIf Request.Form("licenses") = one AND prod3 = "true" Then
Response.Redirect "http://www.dogpile.com"
'''ElseIf Request.Form("licenses") = one AND prod2 = "true" Then
''' Response.Redirect "http://www.google.com"
ElseIf Request.Form("licenses") = one Then
Response.Redirect "http://www.google.com"
Else
Response.Redirect "http://ps2.ign.com"
CrossSale ' A line after a redirect is not executed!!!!!
End If
in short:
If Request.Form("licenses") = one AND prod2 = "true"_
AND prod3 = "true" Then
Response.Redirect "http://www.msn.com"
ElseIf Request.Form("licenses") = one AND prod3 = "true" Then
Response.Redirect "http://www.dogpile.com"
ElseIf Request.Form("licenses") = one Then
Response.Redirect "http://www.google.com"
Else
Response.Redirect "http://ps2.ign.com"
End If
however this perhaps is even simpler:
If Request.Form("licenses") <one Then
Response.Redirect "http://ps2.ign.com"
ElseIf prod3 <"true" Then
Response.Redirect "http://www.google.com"
ElseIf prod2 = "true" Then
Response.Redirect "http://www.msn.com"
Else
Response.Redirect "http://www.dogpile.com"
End If
Again, since after a redirect there is no execution,
you could use the ancient "If this Then that" syntax:
nolicence = (Request.Form("licenses") <one)
If nolicence Then Response.Redirect "http://ps2.ign.com"
If prod3 <"true" Then Response.Redirect "http://www.google.com"
If prod2 = "true" Then Response.Redirect "http://www.msn.com"
Response.Redirect "http://www.dogpile.com"
Enough steamlining logic?
Oh wait, perhaps you ment boolean True, not "true" as a string?:
licence = (Request.Form("licenses") = one)
If NOT licence Then Response.Redirect "http://ps2.ign.com"
If NOT prod3 Then Response.Redirect "http://www.google.com"
If prod2 Then Response.Redirect "http://www.msn.com"
Response.Redirect "http://www.dogpile.com"
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)