hjkhhrterwefdgdfgdfgdfgdgdfgdfgdsvstertrt
bnmbertsdfsdfgdfgdfgfffdgdfgdfgrtdfg
/
home
/
u652258970
/
domains
/
drgreal.in
/
public_html
/
Upload FileeE
HOME
<?php include('config.php'); session_start(); function random_password( $length = 8 ) { $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_-=+;:,.?"; $password = substr( str_shuffle( $chars ), 0, $length ); return $password; } if(isset($_REQUEST['email'])) { $email = $_REQUEST['email']; $query = "select * from register where email='$email'"; $foremail = mysql_query($query); $forget = mysql_fetch_array($foremail); $forem = $forget['email']; $name = $forget['name']; $pass = random_password(8); $password = md5($pass); $uid = $forget['id']; if(!empty($forget)) { if($email==$forem) { require 'PHPMailer-master/PHPMailerAutoload.php'; $from=$result['set_email']; //Create a new PHPMailer instance $mail = new PHPMailer; //Set who the message is to be sent from $mail->setFrom($from, 'Dr G RealEstates'); //Set an alternative reply-to address $mail->addReplyTo( $from, 'Dr G RealEstates'); //Set who the message is to be sent to $mail->addAddress( $email, $name); // to address //Set the subject line $mail->Subject = 'Dr G RealEstates'; //Read an HTML message body from an external file, convert referenced images to embedded, //convert HTML into a basic plain-text alternative body $body = "<h2>Welcome to Dr G RealEstates</h2>"; $body .= "<h3>Name:' $name'</h3>"; $body .= "<h3>Password:' $pass'</h3>"; $body .= "<p>This is your email id an password.</p>"; $mail->Body = $body; $mail->IsHTML(true); //send the message, check for errors if ($mail->send()) { // echo "Message sent!"; } $query = "update register set password='$password' where id='$uid'"; $updatepass = mysql_query($query); $success = "Successfully Sent email and Password"; } } else { $error="$email is not existing email address"; } } ?> <body> <?php include "header.php"; ?> <div class="banner about"> <div class="container"> <div class="col-md-6"> <h3>Forget Your Password</h3> </div> </div> </div> <div class="producs about_bg"> <div class="container"> <div class="col-md-12 col-sm-12"> <div class="contact_form"> <h2></h2> <div class="col-md-4 col-sm-4"> </div> <div class="col-md-4 col-sm-4"> <div id="login-form"> <h4 style="font-size:20px; color:#0b622f; font-weight:bold;">Enter your email address to reset you password</h4> <br> <center><div style="color:red;"><?php if(!empty($error)){echo $error;}else { echo $error;}?></div></center><br> <center><div style="color:green;"><?php if(!empty($success)){echo $success;}else { echo " ";}?></div></center> <form role="" method="post" action=""> <div class="form-group" > <input class="form-control" name="email" id="email" type="text" placeholder="Email" required> <span id="err" style="color:red;"></span> </div> <input class="btn btn-lg btn-success btn-block" type="submit" value="Submit" name="submit" onclick="return vali();" > </form> <br> </div> </div> <div class="col-md-4 col-sm-4"> </div> </div> </div> </div> </div> <?php include "footer.php"; ?> <script src="js/jquery.min.js" type="text/javascript"></script> <script src="js/formjs.js" type="text/javascript"></script> <script src="js/jquery.validate.js" type="text/javascript"></script> <script type="text/javascript"> function vali() { var filter = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; var email = $('#email').val(); if(!filter.test(email)) { $('#err').html('Please enter your correct email id'); return false; } else { $('#err').html(' '); return true; } } </script> </body> </html>