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

681 بناء مشاريع PHP و MySQL عملية السرد (327) الدالة ()display_account_setup من output_fns.php الجزء V - دالة 27 للحصول على وعرض تفاصيل الحساب function display_account_setup ( $auth_user) { //display empty 'new account form display_account_form($auth_user); $list = get_accounts( $auth_user); // display each stored account foreach($list as $key => $account) { // display form for each accounts details. // note that we are going to send the password for all accounts in the HTML // this is not really a very good idea display_account_form($auth_user, $account['accountid'], $account['server'], $account['remoteuser'], $account['remotepassword'], $account['type'], $account['port']); } دالة لاستخراج كل السرد (427) الدالة ()get_accounts من mail_fns.php تفاصيل حساب مستخدم معين function get_accounts($auth_user) { $list = array(); if(db_connect()) { $query = "select * from accounts where username = '$auth_user' ; $result = mysql_query( $query); { if($result) while($settings = mysql_fetch_array($result)) array_push( $list, $settings); else return false; return $list; } } المكتبة mail_fns.php. الدالة التي تستخرج أي حسابات موجودة هي ()get_accounts، من هذه الدالة مبينة في السرد (27-4). كما ترى، تتصل هذه الدالة بقاعدة البيانات، وتستخرج كل حسابات مستخدم معين، وتعيدها كمصفوفة.
ص٦٦٥

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