التطور للوب بواسطةmysql!PHP - ويلينغ — الصفحة ٧١٨

بناء مدير لائحة عناوين بريدية الفصل 28 السرد (1228) الدالة ()change_password من user_auth_fns.php - تتحقق هذه مرور المستخدم وتحدثها صحة كلمة الدالة من function change_password($email, $old_password, $new_password, $new_password_conf) // change password for email/old_password to new_password // return true or false { // if the old password is right // change their password to new_password and return true // else return false if (login($email, $old_password)) { } if( $new_password==$new_password_conf) { } if (!($conn = db_connect())) return false; $query = "update subscribers set password = password('$new_password') where email = '$email'"; $result = mysql_query($query); return $result; else else echo "<p> Your passwords do not match."; echo "<p> Your old password is incorrect."; } return false; // old password was wrong هذه الدالة مشابهة لبقية دالات إعداد وتغيير كلمات المرور التي نظرنا إليها. إنها تقارن كلمتي المرور الجديدتين اللتين كتبهما المستخدم للتأكد من أنهما متطابقتين، وإذا كانتا متطابقتين، تحاول المستخدم في قاعدة البيانات. تحديث كلمة . مرور تسجيل الخروج عندما ينقر المستخدم الزر Log Out سيتم تنشيط العمل log-out. الشيفرة التي ينفذها هذا العمل في النص البرمجحي الرئيسي هي في الواقع في قسم المعالجة المسبقة في النص البرمجي، كالتالي: if($action == 'log-out') { session_destroy(); unset($normal_user); unset($action); } unset($admin_user); 734
ص٧١٨

نص مستخرج آليًا من الصورة، وقد يقع فيه خطأ.