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
Printable View
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
you can send an email by using the mail function.
you can generate a random password using the following function, taken from php.net:
string $c is the string of characters to use.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;
}
?>
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
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?
I am using MySQL