- Forums
- Windows Hosting
- How To Get Variable From URL in .ASP
Today We Will Show You How You Can Get The Variable From The Url Using Get In A Form [1596], Last Updated: Mon Jun 24, 2024
Webune Tutorials
Tue Dec 08, 2009
0 Comments
402 Visits
today we are going to show you how you can get a variable from an URL, for example, i have this url that looks like this:
http://www.webune.com/forums/default.asp?category=windowsas you can see from the url, the value of category is windows, so to get the value of category from the url and display it on my script all i have to do is use this ASP code:
ASP CODE:
response.write("The Category is: " & request.querystring("category"))
and the output will be like this:
The Category is: windows
also you can get the value using a web form...for example, lets say i have this form:
HTML CODE:
<form method="GET" action="default.asp">
<input type="submit" name="category" value="windows">
</form>
so when you submit the form, it will also get the value of category
we have provided an example script you can download in the attachment section below so you can try it out