Function extend () { $ Coupon_id = isset ($ _ GET ['id'])? Trim ($ _ GET ['id']): ''; If (empty ($ coupon_id )) { Echo Lang: get ('no _ coupon '); Exit; } If (! IS_POST) { Header ("Content-Type: text/html; charset =". CHARSET ); $ This-> assign ('id', $ coupon_id ); $ This-> assign ('send _ model', Lang: get ('send _ Model ')); $ This-> display ("coupon_extend.html "); } Else { If (empty ($ _ POST ['User _ name']) { $ This-> pop_warning ("involid_data "); Exit; } $ User_name = str_replace (array ("r", "rn"), "n", trim ($ _ POST ['User _ name']); $ User_name = explode ("n", $ user_name ); $ User_mod = & m ('Member '); $ Users = $ user_mod-> find (db_create_in ($ user_name, 'User _ name ')); If (empty ($ users )) { $ This-> pop_warning ('involid _ data '); Exit; } If (count ($ users)> 30) { $ This-> pop_warning ("amount_gt "); Exit; } Else { $ Users = $ this-> assign_user ($ coupon_id, $ users ); $ Store = $ this-> _ store_mod-> get_info ($ this-> _ store_id ); $ Coupon = $ this-> _ coupon_mod-> get_info ($ coupon_id ); $ Coupon ['store _ name'] = $ store ['store _ name']; $ Coupon ['store _ id'] = $ this-> _ store_id; $ This-> _ message_to_user ($ users, $ coupon ); $ This-> _ mail_to_user ($ users, $ coupon ); $ This-> pop_warning ("OK", "coupon_extend "); } } } First, coupon_id only filters spaces, and then enters the get_info function in the else statement: Function get_info ($ id) { $ Goods = $ this-> get (array ( 'Condition' => "goods_id = '$ ID '", 'Join' => 'belongs _ to_store ', 'Fields' => 'This. *, store. State' )); ... Omitted After reading the code, you will know that the above conditions and so on are all concatenated into SQL statements and will eventually enter the database. Therefore, injection produces POST index. php? App = coupon & act = extend & id = 1 [exp] Data: user_name = test (user name currently logged on) |