confirmation email for user signup |
[eluser]Brad K Morse[/eluser]
If I was using php w/o CI as the framework, I would display a activation link within the confirm email like: domain.com/[email protected]?key=0301002020 I have not done this in CodeIgniter and was wondering how I would accomplish getting ($_GET) both those variables to pass into a controller function? something like? domain.com/confirm/[email protected]/0301002020 Code: function confirm() {
[eluser]IgnitedCoder[/eluser]
You got it right... domain.com/confirm/email.com - but instead of using the email address... Create a varchar 40 length field in your db, save the users details and generate a md5 or sha key you can store in this new field and use it for email conformation so its only 1 param to your controller function "confirm". Step 1 - Signup Step 2 - Grab confirm key field after record is saved Step 3 send email as follows: Pleae click here to confirm your email address domain.com/confirm/21730ASDRqWAFDGFD/ Confirm function would be as follows. This way your not sending a email in the URL. Code: function confirm($key=''){ By far the safest way to do it. Hope this helps.
|
Welcome Guest, Not a member yet? Register Sign In |