Hallo zusammen,
nach dem eine Seite umgestellt worden ist auf ein ASP Login habe ich Probleme damit diese mit CURL abzurufen
vorher ging es recht simpel:
curl --user user assword 'https://www.yyyy.com' -c cookie1.txt
assword 'https://www.yyyy.com' -c cookie1.txt
auf der neuen Seite https://wsv.mitcom.online komme ich aber leider keinen Schritt weiter.
Ich bekomm entweder den Fehler das die Seite umgezogen ist oder eben 405
Mein letzteversuch auf cmd Ebene war noch dieser
curl --form passwort0=password --form user=name https://wsv.mitcom.online/login.aspx?login=true
nun hab ich das ganze in eine php gepackt die folgendermassen aussieht aber auch nicht wirklich weiterkommet:
	
Hat jemand nen Tipp für mich?
					nach dem eine Seite umgestellt worden ist auf ein ASP Login habe ich Probleme damit diese mit CURL abzurufen
vorher ging es recht simpel:
curl --user user
 assword 'https://www.yyyy.com' -c cookie1.txt
assword 'https://www.yyyy.com' -c cookie1.txtauf der neuen Seite https://wsv.mitcom.online komme ich aber leider keinen Schritt weiter.
Ich bekomm entweder den Fehler das die Seite umgezogen ist oder eben 405
Mein letzteversuch auf cmd Ebene war noch dieser
curl --form passwort0=password --form user=name https://wsv.mitcom.online/login.aspx?login=true
nun hab ich das ganze in eine php gepackt die folgendermassen aussieht aber auch nicht wirklich weiterkommet:
Code:
	
	<?php
$url = "https://wsv.mitcom.online/index.html";
$ckfile = tempnam("/tmp", "CURLCOOKIE");
$useragent = 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/533.2 (KHTML, like Gecko) Chrome/5.0.342.3 Safari/533.2';
$username = "User";
$password = "password";
$f = fopen('log1.txt', 'w'); // file to write request header for debug purpose
/**
    Get __VIEWSTATE & __EVENTVALIDATION
 */
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_COOKIEJAR, $ckfile);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
$html = curl_exec($ch);
curl_close($ch);
preg_match('~<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="(.*?)" />~', $html, $viewstate);
preg_match('~<input type="hidden" name="__VIEWSTATEGENERATOR" id="__VIEWSTATEGENERATOR" value="(.*?)" />~', $html, $eventValidation);
$viewstate = $viewstate[1];
$eventValidation = $eventValidation[1];
/**
 Start Login process
 */
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);
curl_setopt($ch, CURLOPT_COOKIEJAR, $ckfile);
curl_setopt($ch, CURLOPT_COOKIEFILE, $ckfile);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_REFERER, $url);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_STDERR, $f);
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
// Collecting all POST fields
$postfields = array();
$postfields['__EVENTTARGET'] = "";
$postfields['__EVENTARGUMENT'] = "";
$postfields['__VIEWSTATE'] = $viewstate;
$postfields['__VIEWSTATEGENERATOR'] = $eventValidation;
$postfields['user'] = $username;
$postfields['passwort0'] = $password;
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
$ret = curl_exec($ch); // Get result after login page.
print $ret;
?>
Hat jemand nen Tipp für mich?
 
          