I have been working on a PHP referral program, and my conversions have been failing for the past two days. I haven’t encountered this problem before. Please help…
<html>
<head>
<title>PHP</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script>
if (top != self) {
top.location.replace(document.location);
alert("[PHP]For Security Reasons, Framing is Not Allowed, Click OK to Remove The Frames")
}
function copyToClipboard() {
var copyText = document.getElementById("copyText");
copyText.select(); // select the text field
document.execCommand("copy"); // copy the selected text to the clipboard
alert("Copied to clipboard: " + copyText.value);
}
</script>
</head>
<body>
<h2><u>Verify</u></h2>
<?php
include 'function.php';
function CURL($url, $data, $headers, $method, $header_send)
{
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, $header_send);
$output = curl_exec($curl);
return $output;
}
if (isset($_GET['submit1'])) {
$ipaddress = file_get_contents("https://pro.ip-api.com/json/?key=LWKtz4EzQwMJRyQ");
// echo $ipaddress;
$data89 = json_decode($ipaddress, true);
// Check if decoding was successful and "query" field exists
if ($data89 && isset($data89['query'])) {
// Access the "query" field
$query = $data89['query'];
echo "IP ADDRESS : $query";
echo "<br><br>";
}
$otp = $_GET['otp'];
$sr = $_GET['sr'];
$bd = $_GET['bd'];
$bddd = $_GET['bddd'];
$avn = $_GET['avn'];
$dd = $_GET['dd'];
$ir = $_GET['ir'];
$ir_code = $_GET['ircode'];
$now = time();
$url2 = "https://hittv.in/api/verify-otp";
$headers2 = array(
"Host: hittv.in",
"accept: application/json, text/plain, */*",
"content-type: application/x-www-form-urlencoded",
"user-agent: okhttp/4.9.2",
);
$data2 = "phoneNumber=$sr&otp=$otp";
$resp2 = CURL($url2, $data2, $headers2, 'POST', '0');
$obj = json_decode($resp2, true);
$status = $obj['status'];
$token = $obj['token'];
$user_id = $obj['user_id'];
if ($status == "success") {
$url3 = "https://www.ref-r.com/campaign/mobile_app/tracking";
$headers3 = array(
"Content-Type: application/x-www-form-urlencoded",
"User-Agent: Dalvik/2.1.0 (Linux; U; Android $avn; $bddd Build/MRA58K)",
"Connection: Keep-Alive",
"Host: www.ref-r.com",
);
$data3 = "bid=67335&bid_e=9E07D3BA06DBDB90B475406FA37A0D01&event=register&android_id=$dd&mobile=$num&fname=$uname&referCode=$ir_code&referrer=$ir&referrerSource=finger-print&orderID=$user_id&networkSSID=$brand";
$resp3 = CURL($url3, $data3, $headers3, 'POST', '0');
$obj4 = json_decode($resp3, 1);
echo "<div class='ver'><pre>";
echo preg_replace('/^s+/m', '', print_r($obj4, true));
echo "</pre></div>";
echo '<div class="success"><b> ' . $sr . '<form>
<input type="text" id="copyText" value="' . $token . '">
<button type="button" onclick="copyToClipboard()">COPY</button>
</form></b></div><br>';
$data_file = "details_new.json";
$message = '';
$dt = date("d-m-y h:i:s A");
if (!file_exists($data_file)) {
$fh = fopen($data_file, 'w+');
fwrite($fh, $message);
}
$array_data = json_decode(file_get_contents($data_file), 1);
$printdata = array("Userid" => "$user_id", "SR" => "$sr", "Number" => "$num", "DeviceId" => "$dd", "Token" => "$token");
$array_data[] = $printdata;
$final_data = json_encode($array_data, JSON_PRETTY_PRINT);
if (file_put_contents($data_file, $final_data));
}
}
?>
</body>
</html>
OUTPUT
Array
(
[bid] => 67335
[bid_e] => 9E07D3BA06DBDB90B475406FA37A0D01
[Authentication] => success
[conversion_details] => Array
(
[conversion] => fail
)
)
I’ve read the InviteReferrals API documentation, but it didn’t help. Now my only hope is the Stack Overflow community. I hope I can find a solution here.
New contributor
Pradeep Bashera is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.