Re-send activation email!

Ask about a PHP problem here.
Post Reply
mattollie
Posts: 4
Joined: Wed Mar 28, 2012 2:12 am

Re-send activation email!

Post by mattollie »

Hey guys,

Im new to PHP and was wondering if anyone knew a way to resend the activation email. Firstly, i dont know how to make it check to see if the username and email entered match one in the database. Secondly i dont know how to, once matched up, get the activation_code from the database.

I do however know how to get it in an email and send it haha... just need the main part :(

Could anyone help me with this?

Regards,

Matt
bowersbros
Posts: 534
Joined: Thu May 05, 2011 8:19 pm

Re: Re-send activation email!

Post by bowersbros »

If they request it, check in your database the email that they requested it for.
If that email exists, then send them the activation code again (to the email requested) and then you can just treat it as normal.
I don't like to brag, but I wasn't circumcised. I was circumnavigated. ;)

Want to learn something new? Or maybe reinforce what you already know? Or just help out? Please subscribe to my videos: http://goo.gl/58pN9
mattollie
Posts: 4
Joined: Wed Mar 28, 2012 2:12 am

Re: Re-send activation email!

Post by mattollie »

bowersbros wrote:If they request it, check in your database the email that they requested it for.
If that email exists, then send them the activation code again (to the email requested) and then you can just treat it as normal.
Yeah but I'm more after a page that users can visit to get it automatically sent to their email..
bowersbros
Posts: 534
Joined: Thu May 05, 2011 8:19 pm

Re: Re-send activation email!

Post by bowersbros »

just have a page which has an input form (their email address) and check that against the database.
I don't like to brag, but I wasn't circumcised. I was circumnavigated. ;)

Want to learn something new? Or maybe reinforce what you already know? Or just help out? Please subscribe to my videos: http://goo.gl/58pN9
mattollie
Posts: 4
Joined: Wed Mar 28, 2012 2:12 am

Re: Re-send activation email!

Post by mattollie »

bowersbros wrote:just have a page which has an input form (their email address) and check that against the database.
OK, so far i can echo the activation_code from sql with this code...
//resend activation email
function resend_email($email){
	$email = mysql_real_escape_string($email);
	
	$total = "SELECT * FROM user_activations";
	$total2 = mysql_query($total);
		$total3 = mysql_fetch_assoc($total2);
		
		$total3['activation_code'];
		
		echo $total3['activation_code'];
}
this code here displays the activation_code, now i need to know how to get that instead of echo'ing it, into a $activationcode string that i can add to the end of activate.php?aid=$activationcode and email it. Also help with checking the email matches the one in the database and grabs the correct activation code.

Thanks,
bowersbros
Posts: 534
Joined: Thu May 05, 2011 8:19 pm

Re: Re-send activation email!

Post by bowersbros »

try something like this:
$activation_code = "http://blah.com/index.php?acode=" . $total3['activation_code'];
Then look into the mail() function for ideas on how to send emails
I don't like to brag, but I wasn't circumcised. I was circumnavigated. ;)

Want to learn something new? Or maybe reinforce what you already know? Or just help out? Please subscribe to my videos: http://goo.gl/58pN9
mattollie
Posts: 4
Joined: Wed Mar 28, 2012 2:12 am

Re: Re-send activation email!

Post by mattollie »

bowersbros wrote:try something like this:
$activation_code = "http://blah.com/index.php?acode=" . $total3['activation_code'];
Then look into the mail() function for ideas on how to send emails
Hey,

Thanks heaps.. that did the trick got it working so now if they didnt recieve their activation email there is a link that directs them to resend_activation_email that allows them to enter their email and if the email matches one in the database it will send it to that email.

Thanks you have been a good help :)
Post Reply