[php] forget password

does anyone know how to create a forget password file that will send the user their “temporary password” and force them to change it as soon as their login?