Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 174015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T13:26:45+00:00 2026-05-11T13:26:45+00:00

I need to prevent the characters that cause vulnerabilities in the URL. My sample

  • 0

I need to prevent the characters that cause vulnerabilities in the URL.

My sample URL is http://localhost/add.aspx?id=4;req=4.

Please give the list of characters that I need block.

I am using an ASP.NET web page. I am binding the information from an SQL Server database.

I just want to list the characters to stay away from hackers to enter unwanted strings in the URL.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T13:26:46+00:00Added an answer on May 11, 2026 at 1:26 pm

    Depending on what technology you’re using, there is usually a built-in function that will handle this for you.

    ASP.NET (VB) & Classic ASP

    myUrl = Server.UrlEncode(myUrl) 

    ASP.NET (C#)

    myUrl = Server.UrlEncode(myUrl); 

    PHP

    $myUrl = urlencode($myurl); 

    If you simply would like to remove unsafe characters, you would need a regular expression. RFC 1738 defines what characters are unsafe for URLs:

    Unsafe:

    Characters can be unsafe for a number of reasons. The space
    character is unsafe because significant spaces may disappear and
    insignificant spaces may be introduced when URLs are transcribed or
    typeset or subjected to the treatment of word-processing programs. The characters ‘<‘ and ‘>’ are unsafe because they are used as the
    delimiters around URLs in free text; the quote mark (”’) is used to
    delimit URLs in some systems. The character ‘#’ is unsafe and should
    always be encoded because it is used in World Wide Web and in other
    systems to delimit a URL from a fragment/anchor identifier that might follow it. The character ‘%’ is unsafe because it is used for
    encodings of other characters. Other characters are unsafe because
    gateways and other transport agents are known to sometimes modify such characters. These characters are ‘{‘, ‘}’, ‘|’, ‘\’, ‘^’, ‘~’, ‘[‘, ‘]’, and ‘`’.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Are there any compatibility issues that would prevent this from working? Do I need
I need to prevent Session Fixation , a particular type of session hijacking, in
I need to prevent a document from being saved / saved as (say from
I need to prevent user from selecting text (select all or select a portion
I'm going to running thousands of queries into SQL and I need to prevent
Does cygwin allow a statically compiled binary? This would prevent the need for cygwin1.dll
I need to check all of my asp code to prevent SQL injection. Should
I am building a menu in HTML/CSS/JS and I need a way to prevent
I need to present the user with a matrix of which one column is
I need to present a wizard once, the first time my windows forms application

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.