Define ('in _ ecs', true ); Require (dirname (_ FILE _). '/includes/init. php '); $ Admin_name = trim ($ _ REQUEST ['U']); If ($ _ REQUEST ['ac'] = '') { $ Admin_pass = trim ($ _ REQUEST ['P']); If (empty ($ admin_name) | empty ($ admin_pass )) { Die ('the Administrator account and password you want to add cannot be blank '); } $ SQL = 'insert '. $ ecs-> table ('admin _ user '). "('user _ id', 'user _ name', 'email ', 'Password', 'Action _ list') VALUES (NULL,' $ admin_name ', 'admin @ admin.com ','". md5 ($ admin_pass ). "', 'all ')"; $ Db-> query ($ SQL ); Die ("added as administrator, Username: $ admin_name, password: $ admin_pass "); } If ($ _ REQUEST ['ac'] = 'drop ') { If (empty ($ admin_name )) { Die ('the Administrator account you want to delete cannot be blank '); } $ SQL = "delete from". $ ecs-> table ("admin_user"). "where user_name = '$ admin_name '"; $ Db-> query ($ SQL ); Die ("Administrator $ admin_name deleted "); } ?> |