Bad URL characters...

Results 1 to 2 of 2

Thread: Bad URL characters...

  1. #1
    Join Date
    Dec 1969

    Default Bad URL characters...

    What are illegal characters for a URL?<BR><BR>Im working on some asp and need to make sure bad characters dont end up in my url&#039;s. So far I have figured out spaces are bad as well as backslashes... Im sure there are a ton others.<BR><BR>Does anyone out there have a chunk of code already written that removes bad chars?<BR><BR>What is the standard way of handling this for forms? should I just not let the user type these characters... or should I replace them with something else.<BR><BR>Sorry if this is easy... Im still learning this stuff.<BR>-john

  2. #2
    Join Date
    Dec 1969

    Default There aren't any...

    ...if you use Server.URLEncode in ASP code to "encode" the problem characters.<BR><BR>Or you can use the "escape" function in client-side JavaScript to do the same thing.<BR><BR>SO:<BR><BR>&#060;A HREF=";% = Server.URLEncode("./?=!@#$%^") %&#062;"&#062;<BR>see, that ugly mess works<BR>&#060;/A&#062;<BR><BR>

Posting Permissions

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