how to validate user by sending email link or code on email
Collapse
X
-
sweet i just got it all to work nicely emails user id password and code pluss a link to login ill post the full code in the next day or so adding a few final touches :p
-
we just need to find a way to make the code decrypt the actual password being sent to email other then that ive got everything else working
Leave a comment:
-
Originally posted by ozziemale31 View Posti keep getting an encrypted password mate tried different ways
Your new account is setup you can login with login name:rampage and password:d41d8cd98f00b204e9800998ecf8427e
In case you can validate yourself by this code : 65747331
below is my register function in core
PHP Code:function register($name,$pass,$usex,$bday,$uloc,$rname,$ms,$email,$code){
$execms = mysql_query("SELECT * FROM ibwf_users WHERE name='".$name."';");
if (mysql_num_rows($execms)>0){ return 1; }else
{ $pass = md5(strtolower($pass));
$reg = mysql_query("INSERT INTO ibwf_users SET name='".$name."', pass='".$pass."', birthday='".$bday."', sex='".$usex."', location='".$uloc."', regdate='".time()."', email='".$email."', rname='".$rname."',vcode='".$code."', ms='".$ms."' ");
} if
($reg)
{
$pwd = md5(strtolower($pwd));
$subject = "******";
$headers = "From:****@gmail.com";
$time = time();
$ddt = date("M d y", $time);
$vcode = mysql_fetch_array(mysql_query("SELECT vcode FROM ibwf_users WHERE name='".$name."'"));
$epwd = md5(strtolower($pwd));
$uinf = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE name='".$uid."' AND pass='".$epwd."'"));
$body = "Date: $ddt - Account Detail\n\n Hello $name,\n\nYour new account is setup you can login with login name:$name and password:$pwd\n\nIn case you can validate yourself by this code : ".$vcode[0]."";
mail($email, $subject, $headers, $body);$uid = mysql_fetch_array(mysql_query("SELECT id FROM ibwf_users WHERE name='".$name."'"));
$body = "****** welcomes you! We are committed to provide you with unique services, like multimedia messaging, multiplayer online games and lots of other various tools for you to have fun. We know that you come to WAP after getting time from your busy schedule so we are always ready hear to provide you a friendly and fun filled environment to ease your tensions. For any queries please ask any member of Administration Team. Thanks![br/][small]Note: This is an automatically generated message, please do not reply.[/small]";
$msg = mysql_escape_string($msg); autopm($msg, $uid[0]); return 0;
}
}
Leave a comment:
-
i keep getting an encrypted password mate tried different ways
Your new account is setup you can login with login name:rampage and password:d41d8cd98f00b204e9800998ecf8427e
In case you can validate yourself by this code : 65747331
below is my register function in core
PHP Code:function register($name,$pass,$usex,$bday,$uloc,$rname,$ms,$email,$code){
$execms = mysql_query("SELECT * FROM ibwf_users WHERE name='".$name."';");
if (mysql_num_rows($execms)>0){ return 1; }else
{ $pass = md5(strtolower($pass));
$reg = mysql_query("INSERT INTO ibwf_users SET name='".$name."', pass='".$pass."', birthday='".$bday."', sex='".$usex."', location='".$uloc."', regdate='".time()."', email='".$email."', rname='".$rname."',vcode='".$code."', ms='".$ms."' ");
} if
($reg)
{
$pwd = md5(strtolower($pwd));
$subject = "******";
$headers = "From:****@gmail.com";
$time = time();
$ddt = date("M d y", $time);
$vcode = mysql_fetch_array(mysql_query("SELECT vcode FROM ibwf_users WHERE name='".$name."'"));
$epwd = md5(strtolower($pwd));
$uinf = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE name='".$uid."' AND pass='".$epwd."'"));
$body = "Date: $ddt - Account Detail\n\n Hello $name,\n\nYour new account is setup you can login with login name:$name and password:$pwd\n\nIn case you can validate yourself by this code : ".$vcode[0]."";
mail($email, $subject, $headers, $body);$uid = mysql_fetch_array(mysql_query("SELECT id FROM ibwf_users WHERE name='".$name."'"));
$body = "****** welcomes you! We are committed to provide you with unique services, like multimedia messaging, multiplayer online games and lots of other various tools for you to have fun. We know that you come to WAP after getting time from your busy schedule so we are always ready hear to provide you a friendly and fun filled environment to ease your tensions. For any queries please ask any member of Administration Team. Thanks![br/][small]Note: This is an automatically generated message, please do not reply.[/small]";
$msg = mysql_escape_string($msg); autopm($msg, $uid[0]); return 0;
}
}
Leave a comment:
-
Originally posted by ozziemale31 View Postwhat would be kool make it so if a user hasnt logged in for 3 months their activation code expires requiring them to request a new one
Added after 2 minutes:
Originally posted by mirror View Posthey bro one thing i forgot what abt if the user wants to RESEND THE ACTIVATION EMAIL , blah all this mods will really create a revolution for lavalairLast edited by ewanz; 03.02.12, 12:10.
Leave a comment:
-
Originally posted by ozziemale31 View Postwhat would be kool make it so if a user hasnt logged in for 3 months their activation code expires requiring them to request a new one
Leave a comment:
-
what would be kool make it so if a user hasnt logged in for 3 months their activation code expires requiring them to request a new one
Leave a comment:
-
whats u mean? there have many skill u can use my code and ozzie.. just did it and try by try.. i think u had got the chlue
Added after 4 minutes:
Code:$vcode = $_GET['vcode']; if (!$vcode) echo "No code supplied"; else { $check = mysql_query("SELECT * FROM ibwf_users WHERE vcode='$vcode' AND vstatus='1'"); if (mysql_num_rows($check)==1) echo "You have already activated your account"; else { $activate = mysql_query("UPDATE ibwf_users SET vstatus='1' WHERE vcode='$vcode'"); echo "Your account has been activated!"; } }
Added after 5 minutes:
there have many ideas you can use,, i think the simple one u can use the code above by validate through by link in email ...my suggestion that it is smart after activated/validated users redirect to login than no need to enter password and username... just by link...
What's your sitename mirror?Last edited by ewanz; 02.02.12, 15:16.
Leave a comment:
-
hey bro i think we can make use of ozzies verify.php by making the link in email clickable like
you can validate yourself by this code Http://******.net/activate.php?vcode=".$vcode[0]."";
here s the verify.php
Code:<?php include("config.php"); include("core.php"); $bcon = connectdb(); $vcode =($_GET['vcode']); echo("<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.2//EN\" \"http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd\">"); ?> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>Activating Acount</title> <meta http-equiv="Cache-Control" content="no-cache"/> <meta http-equiv="Cache-Control" content="must-revalidate"/> <?php echo gettheme($sid); ?> </head> <body> <?php if (!$bcon){ echo "<p style=\"text-align: center\">"; echo "<img src=\"images/exit.gif\" alt=\"*\"/><br/>"; echo "ERROR! Couldn't connect to database<br/><br/>"; echo "Please try after some time.<br/><br/>"; echo "Thanks!<br/>"; echo "</p>"; echo "</body>"; echo "</html>"; exit(); } $vcode = $_GET['vcode']; if (!$vcode) echo "No code supplied"; else { $check = mysql_query("SELECT * FROM ibwf_users WHERE vcode='$vcode' AND active='1'"); if (mysql_num_rows($check)==1) echo "You have already activated your account"; else { $activate = mysql_query("UPDATE ibwf_users SET validrqd='0' WHERE vcode='$vcode'"); echo "Your account has been activated!"; } } ?>
Leave a comment:
-
Originally posted by ewanz View Postohw,,, i see.. now.. i will code other methods for u.. not use header to other page...
can we just modify it a little like sending randomly generated paswd , (removing paswd fields while registering ) in email , if email n user is genuine he will surely check email n use tht paswd
secondly or by ur method using verify.php or validate.php entering activation code to actiavte
Leave a comment:
-
ohw,,, i see.. now.. i will code other methods for u.. not use header to other page...
Leave a comment:
-
Originally posted by ewanz View Postnot $pwd, i have post before change to $epwd in your core...
verify.php problem header.. do u have include already verify.php in your core.php or config.php?
if does, change header("Location: verify.php"); to header("Location: validate.php");
still same problem
Added after 5 minutes:
Originally posted by ozziemale31 View Postor simply just remove the header the error is becus the header has already been declared
i used this and it verifies :p
Code:<?php include 'config.php'; $code = $_GET['code']; if (!$code) echo "No code supplied"; else { $check = mysql_query("SELECT * FROM ibwf_users WHERE code='$code' AND active='1'"); if (mysql_num_rows($check)==1) echo "You have already activated your account"; else { $activate = mysql_query("UPDATE ibwf_users SET active='1' WHERE code='$code'"); echo "Your account has been activated!"; } } ?>
Last edited by mirror; 02.02.12, 01:44.
Leave a comment:
-
Originally posted by mirror View Postproblem with header on this line 90
header("Location: verify.php");
Warning: Cannot modify header information - headers already sent by (output started at /home/****/public_html/1234/login.php:25) in /home/*****/public_html/1234/login.php on line 90
ohh one more problem using this password:$pwd in email gets blank paswd in email
verify.php problem header.. do u have include already verify.php in your core.php or config.php?
if does, change header("Location: verify.php"); to header("Location: validate.php");
Leave a comment:
-
or simply just remove the header the error is becus the header has already been declared
i used this and it verifies :p
Code:<?php include 'config.php'; $code = $_GET['code']; if (!$code) echo "No code supplied"; else { $check = mysql_query("SELECT * FROM ibwf_users WHERE code='$code' AND active='1'"); if (mysql_num_rows($check)==1) echo "You have already activated your account"; else { $activate = mysql_query("UPDATE ibwf_users SET active='1' WHERE code='$code'"); echo "Your account has been activated!"; } } ?>
Leave a comment:
-
Originally posted by mirror View Postproblem with header on this line 90
header("Location: verify.php");
Warning: Cannot modify header information - headers already sent by (output started at /home/****/public_html/1234/login.php:25) in /home/*****/public_html/1234/login.php on line 90
ohh one more problem using this password:$pwd in email gets blank paswd in email
Code:ob_start();
Leave a comment:
Leave a comment: