Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Session Request Query String

Status
Not open for further replies.

jdm3

Programmer
Sep 8, 2003
20
CA
can someone help me with the request query String session, How do I incorporate the URL String to work with the database if my string is as followed


How can I make these variables communicate when I do a search in the database that it will look into that string, Country, Province, and City to pull out the requested search for that area
 
At the top of city.asp
<%
' get the values and assign them to variables
Country=request.querystring(&quot;country&quot;)
Province=request.querystring(&quot;province&quot;)
City=request.querystring(&quot;City&quot;)

'create your sql statement
strSql=&quot;SELECT * FROM myTable where Country='&quot; & Country & _
&quot;' AND Province='&quot; & Province & &quot;' AND City='&quot; & City & &quot;'&quot;

'create your connection object and let it rip
set conn=server.creatobject(&quot;ADODB.CONNECTION&quot;)
conn.open yourConnectionString
set rs=conn.execute(strSql)
If not rs.eof then
'display your stuff here
End if
set rs=nothing
conn.close
set conn=nothing
%>
 
This ia what I have at the top right now but it's not doing the job.



<!-- #INCLUDE FILE=&quot;adovbs.inc&quot; -->
<%
' Get Current Category
cat = TRIM( Request( &quot;cat&quot; ) )
IF cat = &quot;&quot; THEN cat = &quot;Home&quot;

' Get Search Phrase
searchFor = TRIM( Request( &quot;searchFor&quot; ) )


' Get Current Category
cat = TRIM( Request( &quot;cat&quot; ) )
IF cat = &quot;&quot; THEN cat = &quot;Home&quot;

' Open Database Connection
Set Con = Server.CreateObject( &quot;ADODB.Connection&quot; )
Con.Open &quot;accessDSN&quot;
' Open Recordset with Static Cursor
Set RS = Server.CreateObject( &quot;ADODB.Recordset&quot; )
RS.CursorType = adOpenStatic
RS.ActiveConnection = Con
RS.Open &quot;Select * FROM Products&quot;
' Display Count of Products
Response.Write &quot;Number of products: &quot;
Response.Write RS.RecordCount
%>

<% session(&quot;varFlashPath&quot;)=Request.QueryString(&quot;FlashPath&quot;) %>
<% session(&quot;varFlashName&quot;)=Request.QueryString(&quot;FlashName&quot;) %>
<% session(&quot;varCountryID&quot;)=Request.QueryString(&quot;CountryID&quot;) %>
<% session(&quot;varCountryName&quot;)=Request.QueryString(&quot;CountryName&quot;) %>
<% session(&quot;varProvinceID&quot;)=Request.QueryString(&quot;ProvinceID&quot;) %>
<% session(&quot;varProvinceName&quot;)=Request.QueryString(&quot;ProvinceName&quot;) %>
<% session(&quot;varCityID&quot;)=Request.QueryString(&quot;CityID&quot;) %>
<% session(&quot;varCityName&quot;)=Request.QueryString(&quot;CityName&quot;) %>



<html>
<head>
 
I'm not quite sure exactly what you're trying to do. Use those variables in a query? Add them to the database?
 
here is a breif discription of how this will work, the user as an exemple will not be entering any Cities or Province, as a text or any dropdowns, the User shall be clicking on a Flash Image Geographic Map, he will chose his country, then the Country map will appear, he can then choose the State or Province that he needs, If he is doing a state wide search he would search in the Search feild only Ex: &quot;1965 Corvette&quot;
and if a match is found in that state it will appear, If he wants also to do the search accross the entire country then he should be at the country Map wich will pull out all the 1965 Corvettes in the country, but if he wants to look closer he may click the province map then clicking on a city of choice his search would be specificly for that city. Then while at the city level, he can then do a search for any other category that he wishes to do either another car or a for an apartment. I also want it to work as if you chose on the category menu Automobile Dealerships and Chosing Toyota then all Toyota dealerships ads would appear for that City, at whatever map level that he choses, But in Order for the User to place an Ad he must chose the City that he wants the Ad to appear, if he tries to place an Ad when he only choses the Country or Province/State then he cannot place an Ad until he choses his City. Now everytime you click on the map it places the variables in the URL I want to make these variables work with the Variables that the categories, at this time I can click all the maps and the String appears in the URL as memtion Above on the first Posting, when I click on a gategory I lose my Map which disapears and the categories appear.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top