Gan Saya lagi nyoba buat forgot password tp kok d email gag masuk ya. ini form nya
Kirim
ini script forgot-password.php nya // include conn & functions here ... if [ isset[ $_POST['forgot'] ] ] : $email = $mysqli->real_escape_string[ anti_injection[ $_POST['email'] ] ]; $sql = $mysqli->query[ "SELECT email FROM member WHERE email = '$email'" ]; $check = $sql->num_rows; $data = $sql->fetch_assoc[]; if [ $check >= 1 ] { $rad_pass = 'ABCDFRG1234567890'; // pswd before hashing $salt = 'abcdefghijklmnopqrstuvwqyz1234567890'; $cost = 10; $options = array[]; if [ !empty[$cost] ] $options['cost'] = [int]$cost; if [ !empty[$salt] ] $options['salt'] = $salt; $new_pass = $mysqli->real_escape_string[ password_hash[ $rad_pass, PASSWORD_DEFAULT, $options ] ]; $update_pass = $mysqli->query[ "UPDATE member SET password = '$new_pass' WHERE email = '$email'" ]; $to = $email; $from = '[email protected]'; $subject ="Password Changed"; $message = "your password has been changed successfully. Your password is $rad_pass "; $success = mail[$to, $from, $subject, $message]; // mail[$to,$from,$message,$header]; echo "alert[ 'Silahkan cek email Anda.' ]; document.location.href='./?page=forgot-pswd';"; } else { die [ "Akun tidak terdaftar." ]; } endif; $mysqli->close[];
@arman12
29 Kontribusi 1 Poin
Dipost: 6 tahun yang lalu Update 2 tahun yang lalu
Jawaban
// mail[$to,$from,$message,$header]; coba ganti mail[$to,$from,$message,$header]; dan kalau boleh saya saran, lebih baik agan coba dulu di web biasa, jangan langsung kirim email. Jadi tahu salahnya dimana //CMIIW
Sblumnya sbnrnya sy sdh spt itu gan pnulisanan. Itu bntuk sderhananya karena bnyk tutor jg yg spt itu, hehe Utk pngtesannya langsung sy tes dihosting menggunakan subdomain sy. Tp hasilnnya nihil nih blm nemu solusi
@arman12
29 Kontribusi 1 Poin
Dipost: 6 tahun yang lalu
Login untuk gabung berdiskusi
Permalink
Cannot retrieve contributors at this time
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Chủ Đề |