DarkBy adlı üyeden alıntı: mesajı görüntüle
yapamazsanız haber verin anydeskten ücretsiz yardımcı olurum.
Misafir adlı üyeden alıntı: mesajı görüntüle
session tanımlayarak yapabilirsin

if(!isset($_SESSION['mobileVerify']) && $_SERVER['REQUEST_URI'] != "/mobilsorgu.php") {
@header('Location: /mobilsorgu.php');
exit;
}
mobilsorgu.php de form koyup, sms kodunu telefon numarasına gönderirken

$_SESSION['_2faCode'] = "1234";
tanımlayarak, gönderdikten sonra bu session verisinden yine kontrol edeceksin form ile.

get
file_get_contents(sprintf("https://smsfirman.com/api.php?%s", http_build_query(array("telefon"="5553332211","sms"=>"doğrulama kodunuz 1234"))));
veya post
file_get_contents("https://smsfirman.com/api.php",false,stream_context_create(array("http"=> array("method"=>"POST","content"=>http_build_query(array("telefon"="5553332211","sms"=>"doğrulama kodunuz 1234"))))));
veya curl, post değilse diğer örnekten kopyalarsın
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://smsfirman.com/api.php");
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array("telefon"="5553332211","sms"=>"doğrulama kodunuz 1234")));
//@curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$result = curl_exec($ch);
curl_close($ch);
if(!isset($_SESSION['_2faCode'])) {
$_2faCode = filter_input(INPUT_POST, '_2faCode');
if($_2faCode != $_SESSION['_2faCode']) {
@header('Location: /mobilsorgu.php');
exit;
} else {
$_SESSION['mobileVerify'] = 1;
@header('Location: /index.php');
exit;
}
}
İlginiz ve yardımlarınız için teşekkür ederim , her birinizden birer ipucu alarak çözdüm