|
-
May 24th, 2009, 11:22 AM
#1
Thread Starter
Junior Member
Sending E-mail after registration?
Ok, well I need my PHP script to send a e-mail after someone enters there e-mail.
Also
Can someone help me with registration thing
I need it to give user random password then e-mail it
-
May 24th, 2009, 01:18 PM
#2
Re: Sending E-mail after registration?
you can send an email by using the mail function.
you can generate a random password using the following function, taken from php.net:
PHP Code:
<?php function rand_chars($c, $l, $u = FALSE) { if (!$u) for ($s = '', $i = 0, $z = strlen($c)-1; $i < $l; $x = rand(0,$z), $s .= $c{$x}, $i++); else for ($i = 0, $z = strlen($c)-1, $s = $c{rand(0,$z)}, $i = 1; $i != $l; $x = rand(0,$z), $s .= $c{$x}, $s = ($s{$i} == $s{$i-1} ? substr($s,0,-1) : $s), $i=strlen($s)); return $s; } ?>
string $c is the string of characters to use.
integer $l is how long you want the string to be.
boolean $u is whether or not a character can appear beside itself.
Examples:
rand_chars("ABCEDFG", 10) == GABGFFGCDA
rand_chars("ABCEDFG", 10, TRUE) == CBGFAEDFEC
-
May 24th, 2009, 06:00 PM
#3
Fanatic Member
Re: Sending E-mail after registration?
That's a really useful function there kows, great find .
Are you storing these in a database, or how are you planning on keeping the new logins?
-
May 24th, 2009, 06:07 PM
#4
Thread Starter
Junior Member
Re: Sending E-mail after registration?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|