Merhaba sebebini anlayamadığım bir sorunum var. Oluşturulan linki curl veya file get ile çağırıp linki 1 kerelik çalıştırmam gerekli fakat curl ve file get ile bir türlü çalıştıramadım. Kod Aşağıdaki gibidir. Kod uygulamadan gönderilen verilerle link son şeklini alıyor. Link oluşturuluyor burda bir sorun yok sadece curl veya filegetle veya varsa başka bir yöntemle 1 kerelik bağlantıya tıklatmam gerekli apiden işleme koysun diye yardımcı olabilirseniz sevinirim. Bu arada curl fonksiyonları falan açık.
<?php
include_once($_SERVER['DOCUMENT_ROOT']."/core/init.inc.php");
include_once($_SERVER['DOCUMENT_ROOT']."/config/api.inc.php");
if (!empty($_POST)) {
$accountId = isset($_POST['accountId']) ? $_POST['accountId'] : 0;
$account = new account($dbo, $accountId);
$mypage = $account->getInstagramPage();
$accessToken = isset($_POST['accessToken']) ? $_POST['accessToken'] : '';
$link = "http://takipciartirma.co/api/v2/?key=aaaaaaaaaaawwewewe&action=add&service=1&link={$mypage}&quantity=100";
file_get_contents($link);
$cost = isset($_POST['cost']) ? $_POST['cost'] : 0;
$cost = helper::clearInt($cost);
$fullname = helper::clearText($fullname);
$fullname = helper::escapeText($fullname);
$auth = new auth($dbo);
if (!$auth->authorize($accountId, $accessToken)) {
api::printError(ERROR_ACCESS_TOKEN, "Error authorization.");
}
$result = array("error" => true,
"error_code" => ERROR_UNKNOWN);
$balance = $account->getBalance();
if ($balance >= $cost) {
$account->setBalance($account->getBalance() - $cost);
$result = $account->setfullname($link);
//$result = echo(file_get_contents($link));
}
echo json_encode($result);
exit;
}
?>