Passing variables by link.


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Passing variables by link.

  1. #1
    Matt Guest

    Passing variables by link.


    I was wondering if there is anyway of passing a variable by a link.

    Matt


  2. #2
    Colin Guest

    Re: Passing variables by link.


    Yea, like this:

    http://www.yourname.com/yourpage.asp?variable=string



    "Matt" <mthead28@hotmail.com> wrote:
    >
    >I was wondering if there is anyway of passing a variable by a link.
    >
    >Matt
    >



  3. #3
    myLittleAdmin Guest

    Re: Passing variables by link.


    You just need to use the common url syntax

    <%
    myUrl = "test.asp?var1=" & server.urlencode(var1) & "&var2=" & server.urlencode(var2)
    %>
    <A HREF="<%=myUrl%>">Link</A>

    Then you get the value of your variables in your link with
    <%
    var1 = Request.QueryString("var1")
    var2 = Request.QueryString("var2")
    %>

    That's all

    _____________________________________________
    myLittleTools.net : A new concept of tools
    myLittleAdmin : Web-based database administration tool
    http://www.mylittletools.net
    _____________________________________________


    "Matt" <mthead28@hotmail.com> wrote:
    >
    >I was wondering if there is anyway of passing a variable by a link.
    >
    >Matt
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center