473,382 Members | 1,400 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Validating a valid URL

Is there a function that validates if a URL is valid or not? Basically I'm
trying to filter out bogus input, and things like cross site scripting
attacks.

Example:
<img src="javascript:alert(document.cookie)">

Doing it by regex seems way too complicated and there could be holes in the
logic if something is missed.
Jul 21 '05 #1
1 1116
Shabam,

Your question is not new in dotnet Newsgroups, I did a search on Google
here are some, sorry using regex.

http://tinyurl.com/69yyr

When that does not fit, I would ask it as well crossposted as you already
did in the newsgroups.
Microsoft.public.dotnet.languages.vb (or csharp) according what you use
and
Microsoft.public.dotnet.framework.aspnet

I hope this helps?

Cor

"Shabam" <bl******@hotmail.com> > Is there a function that validates if a
URL is valid or not? Basically I'm
trying to filter out bogus input, and things like cross site scripting
attacks.

Example:
<img src="javascript:alert(document.cookie)">

Doing it by regex seems way too complicated and there could be holes in
the
logic if something is missed.

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: The Plankmeister | last post by:
Hi... What's the best method of validating input characters? I would like to prevent users submitting exotic characters (such as those acquired on Windows Systems by pressing ALT+) and thought...
1
by: davisjoseph | last post by:
Hi All, I'm using Xerces C++ 2.50 DOM version for Validating a valid XML againt the Schema(XSD) available; But it always shows an error in XSD I suppose; This is the error I'm getting using...
3
by: Mark | last post by:
Hi, Im trying to validate a form, all the validating works apart from one field. This particular field must consist of the first 2 characters as letters, & the following 5 as numbers. And if it...
0
by: jean-gert nesselbosch | last post by:
hello everybody, does anybody know of standardization efforts concerning the output of w3cSchema/relaxNG-validating parsers ? I use libxml2 for validation-purposes (w3c-Schema and relaxNG) and...
1
by: Brian Kedersha | last post by:
I found code for validating XML documents with the XML Schema cashed for rapid access. Example 3: Validating with XMLSchemaCache. ...
15
by: qazmlp | last post by:
What is the best & fastest way of validating an IPv4 address? Basically, the input can be either in IPAddressv4 or IPAddressv4:port format. Currently I have the following code to validate the...
1
by: Chris Lieb | last post by:
I have an XML Schema file that I know is correct becuase I currently use it in a VB6 program to validate XML documents. Also, if I load an XML file into VS2005 that is not valid against this...
4
by: easoftware | last post by:
I am using VS .Net 2003 and VB. I have an app with one parent and two Mdi child forms. I need to validate data in the Mdi form. The Form.Validating event works when I try to close a Mdi form,...
3
by: TheSteph | last post by:
Hi Experts ! I have a Winform Program in C# / .NET 2.0 I would like to ensure that a value in a TextBox is a valid Int32 when user get out of it (TextBox loose focus)
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.