復制代碼 代碼如下:
 
<input type="hidden" value="chris" /> 
<p>Please specify the email address where you want your new password sent: 
<input type="text" /> 
<input type="submit" value="Send Password" /> 
</form> 
復制代碼 代碼如下:
 
<?php 
session_start(); 
$clean = array(); 
$email_pattern = '/^[^@/s<&>]+@([-a-z0-9]+/.)+[a-z]{2,}$/i'; 
if (preg_match($email_pattern, $_POST['email'])) 
{ 
$clean['email'] = $_POST['email']; 
$user = $_SESSION['user']; 
$new_password = md5(uniqid(rand(), TRUE)); 
if ($_SESSION['verified']) 
{ 
/* Update Password */ 
mail($clean['email'], 'Your New Password', $new_password); 
} 
} 
?> 
新聞熱點
疑難解答