Deprecated: Function eregi_replace() is deprecated in...
Here is the code
<?php
$outputForUser = "";
if ($_POST['email'] != "") {
// Connect to database
include_once "account/connect_to_mysql.php";
$email = $_POST['email'];
$email = strip_tags($email);
$email= eregi_replace("`", "", $email);
$email = mysql_real_escape_string($email);
$sql = mysql_query("SELECT * FROM members WHERE email='$email' AND emailactivated='1'");
$emailcheck = mysql_num_rows($sql);
if ($emailcheck == 0){
$outputForUser = '<font color="#004A80">There is no account with that email address<br />
in our records, please try again.';
} else {
$emailcut = substr($email, 0, 2); // Takes first two characters from the user email address
$randNum = rand();
$tempPass = "$emailcut$randNum";
$hashTempPass = md5($tempPass);
@mysql_query("UPDATE members SET password='$hashTempPass' where email='$email'") or die("cannot set your new password");
$headers ="From: noreply@sourcevibe.com\n"; //from address
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1 \n";
$subject ="Login Password Generated";
$body="<div align=center>Your new password has been generated successfully. <br><br><br>
Your New Source Vibe Password Is:<br> <font color=\"#004A80F\"><u>$tempPass</u></font><br>
Visit the http://www.sourcevibe.com to login using your new password.
<br />
</div>";
if(mail($email,$subject,$body,$headers)) {
$outputForUser = "<font color=\"#004A80\"><strong>Your New Login password has been emailed to you! <br> Check your email for your new password</strong></font>";
} else {
$outputForUser = '<font color="#004A80">Password Not Sent.<br /><br />
Please Contact Us...</font>';
}
}
} else {
$outputForUser = '<div style="text-align: center;"><big
style="color: #004A80;">Forgot your password?</big><br>
</div>
<div style="text-align: center;"><span style="color: #004A80;">Submit</span>
<span style="color: #004A80;">your
email address below to have a new password generated and emailed</span><br
style="color: #004A80;">
<span style="color: #004A80;">to
you instantly!</span>
</div>
';
}
////////////////////////////////////////////////////////////////////
?>
<?php
session_start(); // Must start session first thing
/*
This is the top stuff that nobody can see!
*/
// See if they are a logged in member by checking Session data
$toplinks = "";
if (isset($_SESSION['id'])) {
// Put stored session variables into local php variable
$userid = $_SESSION['id'];
$vibe = $_SESSION['vibe'];
$toplinks = '<a href="member_profile.php?id=' . $userid . '">Profile</a><span style="color: rgb(53, 162, 234);"> • </span>
<a href="http://www.sourcevibe.com">Account</a><span style="color: rgb(53, 162, 234);"> • </span>
<a href="logout.php">Log Out</a>';
} else {
$toplinks = ' <a href="http://www.sourcevibe.com">Register</a> <span style="color: rgb(53, 162, 234);">•</span> <a href="http://www.sourcevibe.com">Login</a>';
}
?>
<LINK REL="SHORTCUT ICON" HREF="http://www.sourcevibe.com/graphics/faveicon.gif">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>
</td>
<LINK REL="SHORTCUT ICON" HREF="http://www.sourcevibe.com/graphics/faveicon.gif">
<title>Forgot Password?</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><link rel="stylesheet" type="text/css" href="default.css"><style>#bodydiv { height: 600px; }</style></head><body> <div id="container"> <div id="content">
<div id="navbar"> <br><br><br><br><?php include 'menu/menu.php'; ?>
</div> <div id="bodydiv">
<form action="forgotpassword.php" method="post" enctype="multipart/form-data" name="newpass" id="newpass">
<br> <?php print "$outputForUser"; ?><br><br>
<div align="center" class="style3">Email:
<input name="email" type="text" id="email" size="38" maxlength="56" />
<input type="submit" name="Submit" value="Get Password" /></td>
</tr>
</form>
</div><div id="footer"></div><div id="underfooter"><p class="footer">
<img alt=""
src="http://harborcitysolutions.com/sourcevibe.com/graphics/layout/line.png"><br>
<a style="color: #35A2EA;" href="http://www.sourcevibe.com"><small>HOME</small></a>|<a style="color: #35A2EA;"
href="http://www.sourcevibe.com/account/member_search.php"> <small>MEMBER SEARCH</small></a>
| <a style="color: #35A2EA;" href="http://www.sourcevibe.com/aboutus.php"><small>ABOUT US</small></a>
| <a style="color: #35A2EA;" href="http://www.sourcevibe.com/contactus.php"><small>CONTACTUS</small></a><br>
<br>© 2013 Source Vibe. Project by <a style="color: #555; font-weight: normal !important;" href="http://www.harborcitysolutions.com"><small>Harbor City Solutions.</small></a> All Rights Reserved.
<br>
<a style="color: #CC0000;" href="problemreport.php" target="_blank"><small><small>Report a Problem</small></a>
<table
style="width: 950px; text-align: left; margin-left: auto; margin-right: auto;"
border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td
style="text-align: center; vertical-align: top;"><div style="position:relative; top: -739px; left:300px;"><?php echo $toplinks; ?></div></td>
</tr>
</tbody>
</table>
</p></div> </div></div></div></body></html>