C0deplay Team j8g view code/* modify Personal Data Processing */elseif ($ action = 'act _ edit_profile ') {include_once (ROOT_PATH. 'regiondes/lib_transaction.php '); $ birthday = trim ($ _ POST ['birthdayyear']). '-'. trim ($ _ POST ['birthdaymonth']). '-'. trim ($ _ POST ['birthdaydayday']); $ email = trim ($ _ POST ['email ']); $ other ['msn '] = $ msn = isset ($ _ POST ['extend _ field1'])? Trim ($ _ POST ['extend _ field1 ']): ''; $ other ['qq'] = $ qq = isset ($ _ POST ['extend _ field2 '])? Trim ($ _ POST ['extend _ field2 ']): ''; $ other ['Office _ phone'] = $ office_phone = isset ($ _ POST ['extend _ field3 '])? Trim ($ _ POST ['extend _ field3 ']): ''; $ other ['home _ phone'] = $ home_phone = isset ($ _ POST ['extend _ field4 '])? Trim ($ _ POST ['extend _ field4 ']): ''; $ other ['mobile _ phone'] = $ mobile_phone = isset ($ _ POST ['extend _ field5 '])? Trim ($ _ POST ['extend _ field5 ']): ''; $ sel_question = empty ($ _ POST ['sel _ question'])? '': $ _ POST ['sel _ question ']; $ passwd_answer = isset ($ _ POST ['passwd _ answer'])? Trim ($ _ POST ['passwd _ answer ']): '';/* update data of user extension fields */$ SQL = 'select id from '. $ ecs-> table ('reg _ fields '). 'Where type = 0 AND display = 1 order by dis_order, id'; // read the id of all extended fields $ fields_arr = $ db-> getAll ($ SQL ); foreach ($ fields_arr AS $ val) // cyclically update Extended user information {$ extend_field_index = 'extend _ field '. $ val ['id']; if (isset ($ _ POST [$ extend_field_index]) {$ temp_field_content = strlen ($ _ POST [$ extend_field _ Index])> 100? Mb_substr (htmlspecialchars ($ _ POST [$ extend_field_index]), 0, 99): htmlspecialchars ($ _ POST [$ extend_field_index]); $ SQL = 'select * FROM '. $ ecs-> table ('reg _ extend_info '). "WHERE reg_field_id = '$ val [id]' AND user_id = '$ user_id'"; if ($ db-> getOne ($ SQL) // if no record exists, insert {$ SQL = 'update '. $ ecs-> table ('reg _ extend_info '). "SET content = '$ temp_field_content' WHERE reg_field_id = '$ val [id]' AND u Ser_id = '$ user_id' ";} else {$ SQL = 'insert '. $ ecs-> table ('reg _ extend_info '). "('user _ id', 'reg _ field_id ', 'content') VALUES (' $ user_id ',' $ val [id] ',' $ temp_field_content ') ";}$ db-> query ($ SQL) ;}/ * password writing prompt and answer */if (! Empty ($ passwd_answer )&&! Empty ($ sel_question) {$ SQL = 'update '. $ ecs-> table ('users '). "SET 'passwd _ question '=' $ sel_question ', 'passwd _ answer' =' $ passwd_answer 'where 'user _ id' = '". $ _ SESSION ['user _ id']. "'"; echo $ SQL; $ db-> query ($ SQL );}