SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    May 2005
    Location
    Ohio
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Redirect to Url+var, I'm lost

    Ok boss wants me to do a redirect to a url+CustID#, so we can give them credit for clicking a link.

    This is what I got:

    Pretty self explanetory:
    Code:
     strID=Request.cookies("User")
    %>
    this confuses me:
    Code:
     Goto AnySite <a href=http://www.Anysite.com?&strID=" & strID & ";"><img src='images/unsuspend.gif' alt='main' target=_self></a><br>
    Results in www.Anysite.com/?&strID="

    strID is a number, I'll fix my lazy coding after it's working, to reduce the hackability of it, but blah blah.

    I'm really stuck here, I've read countless articles about it and am getting more lost with each one. Any help would be appreciated.

    The cookie exists and the strID=request.cookies("user") works for other aspects (loging in for one). I'm just a dumby for this.

  2. #2
    doing my best to help c2uk's Avatar
    Join Date
    May 2005
    Location
    Cardiff
    Posts
    1,832
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Lets take a look how the link should look like when you don't use a variable:

    Code:
    <a href="http://www.Anysite.com/?strID=123456">
    I'm not really sure why you use &, or why you don't use either " or ' after the =, but after strID, and for what reason you've got there a ;

    I'm also very confused, why you put the target into the img tag, again without '

    Keep in mind, I'm far from being an advanced ASP coder (VBScript), just started with it two months ago.

  3. #3
    SitePoint Enthusiast
    Join Date
    Dec 2003
    Location
    New Zealand
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    Goto AnySite <a href="http://www.Anysite.com?strID=<%=strID%>">[img]images/unsuspend.gif[/img]

  4. #4
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if your using asp then its like spooky said, <a href="http://www.Anysite.com?strID=<%= strID %>"><img src='images/unsuspend.gif' alt='main' target=_self></a>

    or you can use the cookie directly. If you have a variable, you can use <%= variable %> which is the same as <% response.write(variable) %>

    Gav


  5. #5
    SitePoint Member
    Join Date
    May 2005
    Location
    Ohio
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sweet, thanks

    C2uk, I had the & in there cause I was playing with everything and forgot to take it out.

    Spooky+Groberts /smack me, thanks never thought about <% %> I'm such a newb.

  6. #6
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No such thing as a newbie, just inexperienced ( with no offence implied. )

    You'll learn and when you do, ASP is so easy to build applications and scripts that can do so much.

    Hope you enjoy it.

    Gav



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •