Location: PHPKode > projects > SiteX > password.php
<?PHP
ob_start();
session_start();
include("includes/globals.php.inc");
include("includes/functions.php");
include("lang/English.php");
if(strtolower($sxSetup['Language']) != 'english') include("lang/".$sxSetup['Language'].".php");
include("themes/$THEME_FOLDER/config.php.inc");

if($Submit)
{
	$query = "SELECT * FROM $DB_Users";
	$result = mysql_query($query) or queryError("1100", mysql_error());
	while($ROW = mysql_fetch_object($result))
	{
		if($ROW->email == $email)
			$found = 1;
	}

	if($found)
	{
		$email = htmlspecialchars($email);
		$query = "SELECT * FROM $DB_Users WHERE email='$email'";
		$result = mysql_query($query) or queryError("1101", mysql_error());
		$ROW = mysql_fetch_object($result);
		
		$sxMailBody = $sxLangMail['UserResendInfo'];
		$sxMailBody = str_replace('[USERNAME]', $ROW->username, $sxMailBody);
		$sxMailBody = str_replace('[PASSWORD]', $ROW->password, $sxMailBody);
		
		mail("$ROW->email", $sxLangMail['SubjectUserResendInfo'], $sxMailBody, "From: ".$sxSetup['AdminEmail']);
		
		$message = $sxLang['MessagePasswordSent'];
	
	}
	else
		$message = $sxLang['MessageUserNotFound'];
}

$sxTitleAddendum = $sxLang['UserHeadingRecovery'];
include("themes/$THEME_FOLDER/header.php");
?>
  <div class="bodyWrapper">
	<h1><?PHP echo $sxLang['UserHeadingRecovery']; ?></h1>
	<?PHP echoMessage($message); ?>
	<p><?PHP echo $sxLang['UserRecoveryMessage']; ?></p>
	<form name="sxFormRecovery" method="post" action="<?PHP echo $PHP_SELF; ?>">
	  <?PHP echo $sxLang['UserItemEmail']; ?>:
	  <input type="text" name="email" />
	  <input type="submit" name="Submit" value="<?PHP echo $sxLang['ButtonSend']; ?>" class="sxButton" />
	</form>
  </div>
<?PHP
include("themes/$THEME_FOLDER/footer.php");
ob_end_flush();
?>
Return current item: SiteX