email)) $this->AddError("Please enter your email address.", "email"); if (count($this->errors) == 0) { $u = User::LoadByEmail($this->email); if ($u === FALSE) $this->AddError("Oops, you have entered an invalid email address.", "email"); else { $u->GenPassword(); $u->Save(); $mt = MailTemplate::LoadByName("forgot"); $mt->ApplyAndSend($u->email, $u->id); } } return (count($this->errors) == 0); } function Save() { $this->saved = 1; //send mail } } $f = new ForgotPasswordForm(); if ($_SERVER["REQUEST_METHOD"] == "POST") { $f->FillFromPost(); if ($f->Validate()) $f->Save(); } /*include "header.inc.php"; $f->Render("forgot.xslt", FALSE); include "footer.inc.php"; */ ?> Forgot Password | Easy Web Video