需要帮助使用curl和php

时间:2017-08-07 07:42:51

标签: php curl

我已发送帖子数据并收到回复,但我需要在同一页面输入otp并收到用户ID。 我该怎么做?请帮帮我,谢谢!

<?php

         if(isset ($_POST['submit'])){

            $number = $_POST['t1'];

}

 $andv = str_shuffle('7f7b631de96ebb6b');   
 $data1 = 'mnc=45&mcc=404&isForRegister=1&appVersionCode=4&appVersionName=1.1&androidVersion=23&androidId='.$andv.'&deviceId='.$andv.'&email=null&advertisingId=7f5816c1-52e7-453e-bc30-ecc6cc05c1aa';
$ch=curl_init();
curl_setopt($ch, CURLOPT_URL,'https://getdatagenie.com/datagenie/api/v1/user/update/deviceToken/?');
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);
curl_setopt($ch, CURLOPT_HEADER,1);
curl_setopt($ch, CURLOPT_POST, 1);
//curl_setopt($ch, CURLOPT_POSTFIELDS,$data1);
//curl_setopt($ch, CURLOPT_HTTPHEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,TRUE);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,0);
$one=curl_exec($ch);
//echo $one;

$data2 = 'msisdn='.$number.'&androidVersion=23&androidId='.$andv.'&deviceId='.$andv.'&deviceType=ANDROID&timeZoneInSeconds=19800&appVersionCode=4&appVersionName=1.1&deviceName=Redmi%203S&installedAppPackages=com.jio.jioplay.tv,com.truecaller,com.cyberlink.youperfect,com.databuddy.app,com.utorrent.client,org.wordpress.android,com.touchtype.swiftkey,com.phonepe.app,com.swiftkey.languageprovider,com.getdailylife,cn.wps.moffice_eng,in.inspirelabs.grabon,com.amazon.kindle&networkType=WIFIoperator=airtel&mnc=45&mcc=404&macAddress=02:00:00:00:00:00&local=en&email=null&advertisingId=7f5816c1-52e7-453e-bc30-ecc6cc05c1aa';
    $ch=curl_init();
    curl_setopt($ch, CURLOPT_URL,'https://getdatagenie.com/datagenie/api/v1/user/getOtp/?');
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);
curl_setopt($ch, CURLOPT_HEADER,1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$data2);
curl_setopt($ch, CURLOPT_HTTPHEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,TRUE);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,0);
$oone=curl_exec($ch);
$datav = json_decode($one,1);
$data5 = $datav[userId];
echo $oone; 
//$otp = $otp1;





  $data3 ='?userId=9389&deviceId='.$andv.'&androidId='.$andv.'&otp=390591&email=null';
  $ch=curl_init();
curl_setopt($ch, CURLOPT_URL,'https://getdatagenie.com/datagenie/api/v1/user/getVerified/');
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);
//curl_setopt($ch, CURLOPT_HEADER,1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$data3);
//curl_setopt($ch, CURLOPT_HTTPHEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,TRUE);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,0);
$one=curl_exec($ch);
echo $one;

?>

在第一个卷曲应用程序中发送详细信息。

在第二个卷曲寄存器中发送详细信息。

在第三个卷曲中,我想用第二个卷曲的响应验证otp, 我该怎么办?

要获取并验证同一页面中的otp,我该怎么办?

0 个答案:

没有答案