Jump to content

Securing Unsubscribe


Codarz360

Recommended Posts

Hey,

 

I'm wondering how to secure my unsubscribe link. Currently the link looks something like this delete.php?id=6 the number is the field id of the email address. However when if someone then changed the to delete.php?id=5 then the email address with the id 5 would be deleted. I have tried doing an MD5 but it doesn't seem to work.

 

Any ideas I've been trying all day.

Link to comment
https://forums.phpfreaks.com/topic/245586-securing-unsubscribe/
Share on other sites

you can do an md5 on the email...

imagine you link becomes: delete.php?id=5&e=XXXKDGDHFGFTSGSJAAS (simulating md5 hash of email)

 

then instead of deleting straight away, you first grab the email with id number = 5, apply md5 to it and check if result is the same as $_GET['e'], if it is, you're good to go.

 

this way, a hacker would need to know the person's email, and also their id in the database. You could also add salt to your hash to make it even more secure.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.