kadamsurekha Posted March 9, 2007 Share Posted March 9, 2007 hello friends! i want to create new users in php. i want to send email to the user on the email address provied with the activation link n then activate his account. when the user clicks on the link from his inbox the page should open n msg "activation succesful" should come with the user created. i want to know which activation link should i send. n can anyone tell me the proper code. i have used the php code which i hav written down <html> <body>Welcome to mobi shop talk <? $email=$_POST["txtEmail1"]; $cemail=$_POST["txtCEmail1"]; $passwd=$_POST["txtPasswd1"]; // The subject $subject = "To activate ur account, Click here"; // The message $message = "Dear $email, Your application for an account is currently awaiting your confirmation. (If you didn't request any registration on our site, you don't need to do anything. You may delete this email; the registration request will be automatically deleted in a few days.) --------------------------------------------------------- HOW TO COMPLETE THE REGISTRATION PROCESS --------------------------------------------------------- To complete the registration process all that you have to do is to click on the following link: http://www.mobishoptalk.com (If your email program does not let you click the above link directly, you can copy and paste it into your browser.) Once the confirmation goes through, you can log in to http://www.mobishoptalk.com/user/login using the following login information: username: $email password: $passwd Thanks for registering at mobishoptalk!"; mail($email, $subject, $message, "From: mobishoptalk.com"); echo "The email has been sent."; ?> <br /> </body> </html> plse tell me which file link to pass to activate. cn any1 help me plse Link to comment https://forums.phpfreaks.com/topic/41901-email-activation/ Share on other sites More sharing options...
benjaminbeazy Posted March 9, 2007 Share Posted March 9, 2007 make a "status" or "confirmed" column in your table and another column with a randomly generated confirmation code send the code in an e-mail to a page that checks the $_GET var with the code in the field, if they match set status to active or something like that Link to comment https://forums.phpfreaks.com/topic/41901-email-activation/#findComment-203178 Share on other sites More sharing options...
benjaminbeazy Posted March 9, 2007 Share Posted March 9, 2007 here's my random confirmation code generator function assign_rand_value($num) { // accepts 1 - 36 switch($num) { case "1": $rand_value = "a"; break; case "2": $rand_value = "b"; break; case "3": $rand_value = "c"; break; case "4": $rand_value = "d"; break; case "5": $rand_value = "e"; break; case "6": $rand_value = "f"; break; case "7": $rand_value = "g"; break; case "8": $rand_value = "h"; break; case "9": $rand_value = "i"; break; case "10": $rand_value = "j"; break; case "11": $rand_value = "k"; break; case "12": $rand_value = "l"; break; case "13": $rand_value = "m"; break; case "14": $rand_value = "n"; break; case "15": $rand_value = "o"; break; case "16": $rand_value = "p"; break; case "17": $rand_value = "q"; break; case "18": $rand_value = "r"; break; case "19": $rand_value = "s"; break; case "20": $rand_value = "t"; break; case "21": $rand_value = "u"; break; case "22": $rand_value = "v"; break; case "23": $rand_value = "w"; break; case "24": $rand_value = "x"; break; case "25": $rand_value = "y"; break; case "26": $rand_value = "z"; break; case "27": $rand_value = "0"; break; case "28": $rand_value = "1"; break; case "29": $rand_value = "2"; break; case "30": $rand_value = "3"; break; case "31": $rand_value = "4"; break; case "32": $rand_value = "5"; break; case "33": $rand_value = "6"; break; case "34": $rand_value = "7"; break; case "35": $rand_value = "8"; break; case "36": $rand_value = "9"; break; } return $rand_value; } function get_rand_id($length) { if($length>0) { $rand_id=""; for($i=1; $i<=$length; $i++) { mt_srand((double)microtime() * 1000000); $num = mt_rand(1,36); $rand_id .= assign_rand_value($num); } } return $rand_id; } // end confirm code generation $c_code = get_rand_id(16); Link to comment https://forums.phpfreaks.com/topic/41901-email-activation/#findComment-203179 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.