get parameter in url

J

Jean-Paul Lauque

Hello,

I'm beginner in ASP.

I would like to get parameter of ASP script in URL

example : /localhost/example.asp?parameter1

How can i to get this parameter ?

Thanks a lot

JP
 
S

Steven Burn

Example;

Dim strPar
strPar = Request.QueryString("parameter1")

or

sPath=sPath&"?"&Request.ServerVariables("QUERY_STRING")

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
 
B

Bullschmidt

Example URL with a querystring:
http://www.mysite.com/mydir/mypg.asp?myvar1=hey&myvar2=ho

Because a variable might contain some odd characters like spaces, it's
usually a good idea to use Server.URLEncode when creating a querystring
from a variable:
<a href="http://www.mysite.com/mypage?id=<%=
Server.URLEncode(objRS("MyIDFldFromDB")) %>">objRS("MyIDFldFromDB")</a>

And in the page that is opened you can use Request.QueryString("id") to
get the value of id.

Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top