Definitely validate and modify before inserting into the database. Better
to spend the extra time once, on input, than every time you need to output
it.
In terms of validation, definitely make sure it begins with "http://" but
don't stick on the "www". Not all websites begin with "www" (especially
when the user enters an IP Address instead of a domain name). And if you
really want to verify the URL, validate that it works by making a CFHTTP
call to the URL. Make sure to set the Request Timeout to something
reasonably small so the user doesn't sit around waiting for 5 minutes.
HTH
--
Mosh Teitelbaum
evoch, LLC
Tel: (301) 942-5378
Fax: (301) 933-3651
Email: [EMAIL PROTECTED]
WWW: http://www.evoch.com/
-----Original Message-----
From: Deanna Schneider [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 20, 2004 3:28 PM
To: CF-Talk
Subject: Storing URL's
Hey all,
So, I'm sure we've all dealt with storing URL's that users can enter. And,
no matter how much you say, "Start the url with http://" or "start the URL
with www" someone will do it the opposite way.
So, the question is - do you check the format of the url on the insert and
clean them so they're all the same? Or, do you do it on the output? Either
way, are you just checking for the existence of http://, or are you doing
something else super fantabulistic with regex or something that I'm not
thinking of?
-d
--
Deanna Schneider
UWEX-Cooperative Extension
Interactive Media Developer
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

