Greetings,
I have encountered with a problem regarding my script done in PHP and is used for logging into a specific site
which is written in ASP.
I want to POST my user name and pass word to that form log-in but it seems like site is ignoring it.
I eceive absolutely no errors.
Anyone got an idea how to solve this?
PS URL username and password in script are coreect and can be used for logging into site.
I really hope someone could help me!
Thank you!
[code=php]
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, ‘http://www.ajpes.si/login/login.asp?f=1&mdres=1’);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, ‘uporabnik=test2012&geslo=test2012’);
curl_setopt ($ch, CURLOPT_COOKIEJAR, ‘cookie.txt’);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
$store = curl_exec ($ch);
$file = fopen (“1234.txt”, “w”);
fwrite($file, $store);
fclose ($file);
$content = curl_exec ($ch);
$content = curl_exec($ch);
if ($content === FALSE) {
die(curl_error($ch));
}
echo $content . “<br />”;
curl_close ($ch);
?>