rondog Posted May 14, 2008 Share Posted May 14, 2008 I am converting a cold fusion form to PHP. This is a subscription form, however, you need to confirm by clicking a link in your email. The current one sends a link that looks like this: index.cfm?page=xcdi&uid=%"-\5CK0EX %0A Thats what it looks like if I hover over the link. If I copy the link it looks like this: index.cfm?page=xcdi&uid=%25%22%2D%5CK0EX%20%0A I know I can just do a confirm.php?id=xx ,but I figued it would be easy for someone to just type that in the url window and put in any id. Is their a way to avoid that? Another solution than id=xx perhaps? Link to comment https://forums.phpfreaks.com/topic/105662-confirm-subscription/ Share on other sites More sharing options...
rondog Posted May 14, 2008 Author Share Posted May 14, 2008 What if I sent a MD5 of their email as their confirmation key..like: subscribe.php?confirm=$md5edEmail the user will see: subscribe.php?confirm=3b7d2776ddcfe9d17833e1078285302d Since MD5 doesn't work backwards, how can I query that against the database? Link to comment https://forums.phpfreaks.com/topic/105662-confirm-subscription/#findComment-541394 Share on other sites More sharing options...
DarkWater Posted May 14, 2008 Share Posted May 14, 2008 http://yoursite.com/subscribe.php?id=ID&act=RANDOM_MD5_CODE_IN_DB When they register, set a random MD5 (md5(uniqid(rand(), true))) in their database record. Then set it to NULL if it matches on subscribe.php. Then, you know they subscribed if activation = NULL. Link to comment https://forums.phpfreaks.com/topic/105662-confirm-subscription/#findComment-541395 Share on other sites More sharing options...
rondog Posted May 14, 2008 Author Share Posted May 14, 2008 Yeah I was afraid of doing that because the table is already made with 15,000+ subscribers. I wanted to try and not alter the table, but I may have to Link to comment https://forums.phpfreaks.com/topic/105662-confirm-subscription/#findComment-541397 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.