https://stars.karatay.edu.tr/srs/
sayfa burası
internette araştırarak yapmaya çalıştım fakat olmadı
yardımlarınızı bekliyorum.
Test
$username='user';
$password='pass';
$postdata = 'ID='.$username.'&PWD='.$password;
// INIT CURL
$ch = curl_init();
// SET URL FOR THE POST FORM LOGIN
curl_setopt($ch, CURLOPT_URL, 'https://stars.karatay.edu.tr/srs/index.php');
// ENABLE HTTP POST
curl_setopt ($ch, CURLOPT_POST, 1);
// SET POST PARAMETERS : FORM VALUES FOR EACH FIELD
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata);
// FOLLOW LOCATION
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
// IMITATE CLASSIC BROWSER'S BEHAVIOUR : HANDLE COOKIES
curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
# Setting CURLOPT_RETURNTRANSFER variable to 1 will force cURL
# not to print out the results of its query.
# Instead, it will return the results as a string return value
# from curl_exec() instead of the usual true/false.
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
// EXECUTE 1st REQUEST (FORM LOGIN)
$store = curl_exec ($ch);
// CLOSE CURL
if ($store=='') {
//username and password are valid
//if login is valid, hotfile website returns nothing
echo '
Login Works!! Enjoy.';
curl_setopt($ch, CURLOPT_URL, 'https://stars.karatay.edu.tr/srs/ajax/transcript.php');
//execute the request
$content = curl_exec($ch);
print $content;
} else {
//username and password are not valid
//if username or password is invalid, the website returns
//invalid username or password page
echo '
Login does not work anymore. Try another one.';
}
?>
sayfayı açtıgım zaman Login Works!! Enjoy. yazısı geliyor sadece ekrana.