Good day guys. Anyone can tell me how to send to email a random password when they register? Thanks
Help registration lavalair
Collapse
X
-
Originally posted by stratosphere View PostGood day guys. Anyone can tell me how to send to email a random password when they register? ThanksPHP Code:$random_number = rand(5000000000,9000000000);
$rform .= "Your Password:<br/><input type=\"hidden\" name=\"pwd\" value=\"$random_number\"/><br/>";
$rform .= "Retype Password:<br/><input type=\"hidden\" name=\"cpw\ value=\"$random_number\"/><br/>";
-
PHP Code:$gen_pass = rand(11111,99999);
// remove the password input field in your registration form.
// inserting in ur sql
password='".$gen_pass."'
// mail it
$message = "Helo, this is your password: .$gen_pass.";
$check = mail("abc@example.com", $message, "Registration@mysite.com");
if($check){
echo "Mail sent!";}
It's n0t that i am afraid to die. Its just that if i die, wh0 wilL loVe her as muCh as i Do?
Comment
-
look for registration successfully completed..
then put this below..
PHP Code:$time = time();
$pass = md5($time);
$newpass= substr($pass,0,6);
////send password to user email using phpmail
$msg = "Your password: ".$newpass."";
$subj = "Registration detailss";
$headers = 'xdos' . "\r\n" .
'Reply-To: jhunwap@gmail.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($email, $subj, $msg, $headers);
///now insert/ update the password of the user
Comment
-
I got this but everytime i check my email and try to login it says wr0ng password, how to fix this? Thanks
PHP Code:if($tolog)
{
$time = time();
$pass = md5($time);
$newpass= substr($pass,0,6);
$msg = "\n Username: ".$uid." \n Password: ".$newpass." \n Security Answer: ".$answer." \n\n Welcome! \n\n haha is a nice friendly chat community that offers lot of exciting and new features. We are glad to have you with us! \n Please feel free to invite your friends along. \n\n Follow the link below to login into your account directly \n http://haha.info/in.php?u=".$uid."&p=".$newpass." \n\n Best Regards, \n Keep";
$subj = "Registration Details";
$headers = 'From: noreply@site' . "\r\n" .
'Reply-To: [email]wah@gmail.com[/email]' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($email, $subj, $msg, $headers);
}else{
echo "<a href=\"index.php\">";
echo "Home</a>";
}
Last edited by arnage; 27.04.12, 20:08.
Comment
-
Originally posted by stratosphere View PostI got this but everytime i check my email and try to login it says wr0ng password, how to fix this? Thanks[/PHP]
Added after 10 minutes:
Originally posted by stratosphere View Postlike this?
if($tolog)
{
$time = time();
$pass = md5($time);
$newpass= substr($pass,0,6);
mysql_query("UPDATE r0bz_r0b_users SET pass='".$newpass."' WHERE id='".$uid."'");
{
in registration find register funtion in your core, funtion register()
/////
PHP Code:$time = time();
$pass = md5($time);
$newpass= substr($pass,0,6);
mysql_query("INSERT INTO r0bz_r0b_users SET BALA, BLA, BLA pass='".$newpass."' ");
Last edited by xdosx; 28.04.12, 06:54.
Comment
Comment