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

  • SEARCH
  • Home
  • 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

I need to prevent my double to print in scientific notation in my file,
I'm working on a couple of Linux tools and need to prevent installation on
I need to know how to prevent users from submit the form multiple times
I need to capture keystokes from a wedge device and prevent any controls or
I need to run a PHP code snippet in a Drupal template and prevent
Is there something special about characters that should be allowed/not allowed in a password?
Basically I need to create a textarea that is character limited, but will have
I want to prevent users from using webcam emulators, I have done that in
I have CKEditor embedded in my page. I need to prevent plain whitespaces and
I need a regex expression that performs a contains function on a input/type=hidden field's

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.