Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-05-2007, 05:30 PM   PM User | #1
Spudhead
Senior Coder

 
Spudhead's Avatar
 
Join Date: Jun 2002
Location: London, UK
Posts: 1,856
Thanks: 8
Thanked 110 Times in 109 Posts
Spudhead is on a distinguished road
MD5-ing a URL

This is more of a thinking-out-loud post, but...

So you know when you get HTML emails and stuff, and the links in them are like: www.domain.com/?81c542367cbf72bb1cc19cbcd91089cd

I want to do that.

I've got myself an MD5-generating script, so that's all good. But I'm assuming that all you do is generate these things into a lookup table in your database, and then when someone clicks such a link, your URL-processing page simply checks that the querystring consists of a 32-character alphanumeric string, looks up that string in the database and takes the appropriate action. It might be a straight redirect (for example to a campaign-specific landing page), it might be an action (for example, unsubscribe the user) followed by a redirect to a static, generic thankyou page.

I guess I've got two... queries. Firstly, I'm thinking that the advantages of using MD5-hashed URLS are that (a) you get to hide a URL that might otherwise give away sensitive information about the folder structure of your application, and (b) you can put a load of information - user id, action to take, redirect url, etc - into one 32-character string. Is that about right? If I'm wrong about why to use MD5'd URLs, then I'm probably using them wrong, too

Secondly... this.. dropping them into the database thing. Have I got that right? Because if I'm sending, say, 1000 emails a time, each with... 5 links in... then my lookup table is going to get very big, very fast. Is there another way?

Apologies for the vague and nebulous post. Any suggestions or guidance would be appreciated.

Spudhead is offline   Reply With Quote
Old 11-05-2007, 07:43 PM   PM User | #2
bootcom
New Coder

 
Join Date: Jul 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
bootcom is an unknown quantity at this point
Your looking into URL masking, although I do like the idea behind md5'ing using a db backend ... very nice ... but your right you would get a massive database very quickly ...

I believe you would be best off looking for an ISAPI filter for IIS that does this for you, although if your on a shared web host like I am this is difficult.

There's plenty of stuff out there on google. Is this what you're looking for or am I totally out of left field on this one ?
bootcom is offline   Reply With Quote
Old 11-06-2007, 09:20 AM   PM User | #3
Whatever Jr.
Regular Coder

 
Join Date: Sep 2007
Posts: 120
Thanks: 0
Thanked 3 Times in 3 Posts
Whatever Jr. is an unknown quantity at this point
Hi,
The amount emails doens't matter. You need a hashed string for each action (redirect, update, etc).
and if you have ids for specific campaigns, just add them to the querystring.

Then you know that only the first 32 characters are a string, the rest is a unique ID.

HTH, Tom
Whatever Jr. is offline   Reply With Quote
Old 11-06-2007, 10:09 AM   PM User | #4
Spudhead
Senior Coder

 
Spudhead's Avatar
 
Join Date: Jun 2002
Location: London, UK
Posts: 1,856
Thanks: 8
Thanked 110 Times in 109 Posts
Spudhead is on a distinguished road
Ah, that's not a bad idea. Have a small number of hashed keys that correspond to a combination of, say, campaign ID and action, and simply drop the contact ID - which is the one that would have to be unique per email - onto the end.

Ta

(bootcom - ISAPI filter might do it, but I'd prefer to keep this within my application code for portability)

Last edited by Spudhead; 11-06-2007 at 10:12 AM..
Spudhead is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:13 AM.


Advertisement
Log in to turn off these ads.