Click to See Complete Forum and Search --> : The output is both of my condition's options, how can it be?


ozpo1
01-30-2006, 05:22 PM
For general information (maybe it's important) I'm calling this asp page from an html page with the following lines:

<a href="nocontractor.asp?state=California">
<img border="0" src="http://getcontractor.com/images/usmap1.jpg" alt="map of usa" style="margin-top:0.2cm" width="360" height="260">
</a>

My problem is that the server avoid a condition in my asp file:

<% if Request.QueryString("state")="California" then %> From California <% else %> In Your Area <% end if %> </span></h1>


Instead of writing one of the options, the srever write them both: output:

From California In your Area.

I'm trying to understand it for hours now, please help. Thanks, Oz.

buntine
01-30-2006, 07:05 PM
Try some debugging.

Response.Write Request.QueryString("state")

If ( Request.QueryString("state") = "California" ) Then
Response.Write "Cali"
Else
Response.Write "Unknown"
End If

Regards.

Ubik
01-31-2006, 10:21 AM
<% if Request.QueryString("state")="California" then %> From California <% else %> In Your Area <% end if %> </span></h1>

Try this:
<% if trim(lcase(Request.QueryString("state")))="california" then %> From California <% else %> In Your Area <% end if %> </span></h1>