Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    May 2007
    Posts
    94
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Avoid ' in the URL

    hmm..i duno how to elaborate this problem that i m facing. ok, let say ..i have a URL wit id number such as
    www.abc.com/memberpage.asp?memberid=12.
    when i add the symbol ' at the end of the url (like that:www.abc.com/memberpage.asp?memberid=12'), and enter, it will display error for my page.
    But when i try to put a ' at this web page here, it will not display any error, how can i do this with ASP languagE?how can i avoid it using ASP language ?
    plz help and guide.thank you.

  • #2
    Senior Coder BarrMan's Avatar
    Join Date
    Feb 2005
    Location
    Israel.
    Posts
    1,644
    Thanks
    69
    Thanked 83 Times in 82 Posts
    You can use the Server.URLEncode() method to avoid symbols that interfere with the querystring.
    Code:
    Dim mybadstr
    mybadstr = "www.'hello'2'birds'.com/mydirectory/'string'=3
    Dim mynewstr
    mynewstr = Server.URLEncode(mybadstr)


  •  

    Posting Permissions

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