Click to See Complete Forum and Search --> : Reading URL


Vaston
01-16-2004, 08:07 PM
Hey
I need a script where it reads the url and depending on what the url is display a certain code. Like if i click a link test.html#1 it will show only that certain code and same if its test.html#2. I dont want it through <a name=""> either as you can see the other coding.
Even if i just click test.html and it remembers through ASP Server what part of code i need is great.

Thanks
-Vaston

PeOfEo
01-16-2004, 08:22 PM
request.servervariables("URL") gets the url from the address bar.

Vaston
01-16-2004, 08:32 PM
Sorry but I am a newbie at this.
Once i get the URL from the address bar how do i get it to display the code i want.
Example:
IF URL="test.html#1" THEN
Display "Hello"
ELSEIF URL="test.html#2" THEN
Display "Bye"
END IF

Thanks

PeOfEo
01-16-2004, 08:38 PM
have you considered passing variables by using query strings? Those yoursite.asp?some=something it is an effective way to move data.

if request.servervariables("ur") = "http://blablabla.asp" then
response.write("hi")
else if request.servervariables("ur") = "http://blablabla.asp" then
response.write("bye")
else
response.redirect("dieinthefire.html")
end if

try taking that address after the = sign out of quotes I do not know if it should be in them or not.