<?php
session_start();
function file_get_contents_curl($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
return curl_exec($ch);
}
$txResult = file_get_contents_curl($url); // тут должна быть ваша ссылка на ваш внешний веб-сервис для проверки
if ($txResult == 1) {
header("Location: http://server.com/preauth.php"); /* добавить POST (username+pass) */
exit;
} elseif ($txResult == 0) {
echo "Wrong usename or password!";
}
?>