I am creating a database of information on parks and tourism destinations. Then, visitors will be able to learn more about these destinations using ASP pages. So far so good. In the case of major destinations I want to create entire sections of the website specific to the destination. In these cases, I want visitors to be directed to these pages rather than the database served pages.
Here is what I mean.
For most destinations, the database record will include a short description, contact information and a list of things that you can do there.
In other destinations, I may have dozens of pages detailing the site.
I use a step-by step approach visible on
http://www.mountainnature.com/Destinations/ (Destination/Park Finder). However, when you get to the results page at ParkFinderResults.asp, I would like to have the ability to redirect key destinations to a different page.
Here is my idea. Have a yes/no database field called redirect and another one with the url. When the ParkFinderResults.asp page is loaded, if the redirect field is yes, than the page wil be redirected to the page in the url field.
I hope this makes sense. If there is a better way to handle this I would appreciate your help. I can easily pass the Redirect AND the URL parameters from the page prior to ParkFinderResults.asp.
I've got the process working (sort of). I want the UN-redirected page to continue to the asp page using the DestID to identify the record and also passing on the fDestName field. This final field is the name of a destination and may have spaces in the name. Unfortunately, these are converted into %20 rather than + signs. This totally screws everything up. Here is my current code:
<%
RedirectURL = Trim(Replace(Request.Query
String("UR
L"),"'", "''"))
If Request.QueryString("Redir
ect") = "True" then
response.redirect (replace(request("URL"), "'", "")) & "?DestID=" & Request.QueryString("DestI
D")
else
response.redirect("ParkFin
derResults
.asp?DestI
D=" & Request.QueryString("DestI
D") & "&" & Request.QueryString("fDest
Name"))
end if
%>
The redirected url works perfectly, but the UN-redirecte url is translated as follows:
http://www.mountainnature.com/Destinations/ParkFinderResults.asp?DestID=9&'Elk%20Island%20National%20Park'Obviously it's not passing on the field name for fDestName, but it is passing on the value. How can I get rid of the %20 and replace with + AND remove the single quote around the field value