support

Author Topic: send post data to new view  (Read 7271 times)

Offline shahiran12395

  • Jr. Member
  • **
  • Posts: 50
  • Karma: +3/-0
    • View Profile
send post data to new view
« on: July 25, 2019, 06:12:58 AM »
hi there, im creating new condition where if user exist in system2 the login controller will fetch the data from the system2 and auto register the user. so how can i auto submit the fetch data to rt='account/create'?

below is my code. i just need to post the data to account/create

Code: [Select]
//execute the POST request
                $result = curl_exec($ch);

                //close cURL resource
                curl_close($ch);

                if($result=="false"){
                    header('Location: ' . url.'?rt=account/login&false_entry_login_detail=1');
                    die();

                }
                $user_data = json_decode($result);

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2064
  • Karma: +326/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: send post data to new view
« Reply #1 on: July 26, 2019, 09:20:00 AM »
Hi.
You should to use hooks of controller account/create.

//before controller run (init) you can check is request POST and do something.
see https://github.com/abantecart/abantecart-src/blob/master/public_html/storefront/controller/pages/account/create.php#L33

Also you can do something after account creation  https://github.com/abantecart/abantecart-src/blob/master/public_html/storefront/controller/pages/account/create.php#L75
with updateData hook
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

 

Powered by SMFPacks Social Login Mod