include 'conf/config.php'; if (isset($_POST['email'])) { $form_data = array( 'email' => $_POST['email'] ); $api_url = $api_root."/user/?action=resetmdp"; $client = curl_init($api_url); curl_setopt($client, CURLOPT_POST, true); curl_setopt($client, CURLOPT_POSTFIELDS, $form_data); curl_setopt($client, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($client); curl_close($client); $result = json_decode($response, true); if(!is_null($result)){ if ($result['user_mdp_renew']==1){ header("Location: logrenewmpd.php?id=".$result['user_id']); } }else{ $message = "Cet email n'existe pas !"; } } ?>