User confirmation link email issue |
[eluser]Xeroxeen[/eluser]
Hi i'm developing a web system which users can register.When user registers the confirmation link sends to his/her email address.Then user should click the link to confirm his registration.I'm using google smtp to send the email.It's working properly.The problem is when i click the link it's not marks the user as activated.This is my model and controller. Index Controller Code: $email=$_POST['email']; Model Code: function confirm_registration($register_code){ Why is not working?I checked it manually by running the SQL query.Then it works.Please help!
[eluser]Unknown[/eluser]
Use $_GET or $_POST access your function() Code: $this->email->message('Click the link below to activate your account' . anchor('http://localhost/mySite/index.php/Index/account_activation?id='.$activationCode.'Confirmation Register'));
[eluser]Pert[/eluser]
The link should probably be anchor('http://localhost/mySite/index.php/Index/account_activation<b>/</b>'.$activationCode,'Confirmation Register') index.php/Index/account_activationcode index.php/Index/account_activation<b>/</b>code Also, instead of hardcoding the link to localhost, you can use site_url() so uploading your application to live server doesn't mean you have to manually change all your links.
[eluser]Xeroxeen[/eluser]
[quote author="Pert" date="1371560105"]The link should probably be anchor('http://localhost/mySite/index.php/Index/account_activation<b>/</b>'.$activationCode,'Confirmation Register') index.php/Index/account_activationcode index.php/Index/account_activation<b>/</b>code Also, instead of hardcoding the link to localhost, you can use site_url() so uploading your application to live server doesn't mean you have to manually change all your links.[/quote] Thanks for the reply.I did that way also.But it didn't worked.Anyway i'll check it again.And other urls i have put base_url() function to get the url.for this i forgot to do that thanks for showing me that too.
[eluser]Xeroxeen[/eluser]
Now i put "/" again after the activation function in the url.Now it seems something happened.But now i get this error.Why is this? Quote:A Database Error Occurred
[eluser]Pert[/eluser]
Looks like you're putting quotes around the query and it doubles up. Try this instead (no single quotes around ?) Code: $val_code = "SELECT email FROM `users` WHERE hash=?";
[eluser]Xeroxeen[/eluser]
[quote author="Pert" date="1371626306"]Looks like you're putting quotes around the query and it doubles up. Try this instead (no single quotes around ?) Code: $val_code = "SELECT email FROM `users` WHERE hash=?"; Thank you very much.Now it's working. I removed single quotations around hash and checked.But it didn't worked.Then i removed MD5 part also.Then it woked.Anyway i really appreciate your solution and this forum is really helpful.Thanks again
[eluser]Xeroxeen[/eluser]
[quote author="Pert" date="1371630693"]Happy to help [/quote] I have another issue.If you free to check this is the link http://ellislab.com/forums/viewthread/236174/ |
Welcome Guest, Not a member yet? Register Sign In |