Search
'; include( "cms_dbasecode".DIRECTORY_SEPARATOR."search_form.php" ); echo '- ';
echo '
- live-search results . . . '; echo '
Request login password
"; print_r($_SERVER); echo ""; */ ?> Login . . .'; //start of code to email password $email = mysql_real_escape_string(strip_tags(trim($_POST[user_email]))); //search the database $emailRow = getRow("admin_auth", "user_email", $email); //register a new user if(!$emailRow[user_email]){ $_SESSION[new_member] = 'y'; $date = time(); $password = date("My",$date); $salt = rand(11,99); //$login_password = strtolower($date_str).$login_password; $encrypted_passwd = crypt($password, $salt); $login_password = substr($encrypted_passwd, 0, 8); $user_password = $login_password; //assign the user to the first user_group_id $user_group_id = 1; //then enter the password in database $id = addNewUser($email, $user_password, $user_group_id) ; //$id = newUser($email, $user_password, $date); //extract the username from the first part of the email to use as username $user_email = $email; $namelength = strpos($user_email, '@'); $user_name = substr($user_email, 0, $namelength); //$_POST['user_name'] = substr($user_email, 0, $namelength); if(eregi("\.", $user_name)) //echo "user_name contains a dot"; $user_name = str_replace('.', '_', $user_name); //replace . by _ $user_name = ucwords($user_name); //call function to enter user name in database //updateUserName($id, $user_name); //search the database for the new user $emailRow = getRow("admin_auth", "user_email", $user_email); } //send the email to a registered user if($emailRow[user_email]) { $userPassword = $emailRow[user_password]; $email = $emailRow[user_email]; $subject = 'Your '.$_SESSION[website].' Password'; $message = "Please find herewith your login details: Your password is ".$userPassword." Login email is ".$email." ".$_SESSION[website]." is a free online community for everyone. Please login at ".$_SESSION[root_folder]." Please kindly mention this service to your friends, family and colleagues. Thank You Enjoy the service, ".$_SESSION[website]." online community, (share your knowledge...) "; //send email request if(!$_SESSION[email_sent]){ $from = $_SESSION[emails_from]; mail( "$email", "$subject", "$message", "$from"); //send email to mk if($_SESSION[new_member]) $subject = "New member has joined ".$_SESSION[website]; else $subject = "Existing user has requested password at ".$_SESSION[website]; $message = "The member's email is : ".$email; mail( "mbuso.kulube@gmail.com", "$subject", "$message", "$from"); $_SESSION[email_sent] = "email_sent"; } //echo $message; } //end of code to email password //display contratulatory message echo "Congratulations
Your password has been sent to your email : ".$email.". Please check your email and log-in below.