SELFPHP: Version 5.8.2 Befehlsreferenz - Tutorial – Kochbuch – Forum für PHP Einsteiger und professionelle Entwickler

SELFPHP


Professional CronJob-Service

Suche



CronJob-Service    
bei SELFPHP mit ...



 + minütlichen Aufrufen
 + eigenem Crontab Eintrag
 + unbegrenzten CronJobs
 + Statistiken
 + Beispielaufrufen
 + Control-Bereich

Führen Sie mit den CronJobs von SELFPHP zeitgesteuert Programme auf Ihrem Server aus. Weitere Infos



:: Buchempfehlung ::

PHP 5.3 & MySQL 5.1

PHP 5.3 & MySQL 5.1 zur Buchempfehlung
 

:: Anbieterverzeichnis ::

Globale Branchen

Informieren Sie sich über ausgewählte Unternehmen im Anbieterverzeichnis von SELFPHP  

 

:: Newsletter ::

Abonnieren Sie hier den kostenlosen SELFPHP Newsletter!

Vorname: 
Name:
E-Mail:
 
 

Zurück   PHP Forum > SELFPHP > PHP Grundlagen
Hilfe Community Kalender Heutige Beiträge Suchen

PHP Grundlagen Hier kann über grundlegende Probleme oder Anfängerschwierigkeiten diskutiert werden

 
 
Themen-Optionen Ansicht
  #1  
Alt 07.07.2009, 09:55:12
danimoe danimoe ist offline
Anfänger
 
Registriert seit: Jul 2009
Alter: 37
Beiträge: 2
cURL: Auf einer ASP-Seite Formular befüllen und Ergebnis auslesen

Hallo Forenmitglieder,

Ich habe ein Problem: Und zwar will ich auf TUIfly.com das Formular ausfüllen für die Suche von Flügen und das Ergebnis dann verwerten.

Soweit so gut. Ich versuche in der POST-Anweisung den VIEWSTATE mit zu übergeben. Ich bekomm leider nur die Standardseite mit unausgefüllten Feldern und ohne Stylesheets und JS-Dateien (ist ja klar, glaub ich).

PHP-Code:
curl_login('http://www.tuifly.com/Select.aspx','__EVENTTARGET=ControlGroupAvailabilitySearchSelectView%24AvailabilitySearchInputSelectView%24LinkButtonNewSearch&__EVENTARGUMENT=&__VIEWSTATE=%2FwEPDwUBMGRk8c6YBCrCSJBXIOvLBnRhqSOpiIE%3D&scorigin=CS-Home&ControlGroupAvailabilitySearchSelectView%24AvailabilitySearchInputSelectView%24RadioButtonMarketStructure=RoundTrip&ControlGroupAvailabilitySearchSelectView%24AvailabilitySearchInputSelectView%24DropDownListMarketOrigin1=BRI&ControlGroupAvailabilitySearchSelectView%24AvailabilitySearchInputSelectView%24DropDownListMarketDestination1=CGN&ControlGroupAvailabilitySearchSelectView%24AvailabilitySearchInputSelectView%24DropDownListMarketDay1=09&ControlGroupAvailabilitySearchSelectView%24AvailabilitySearchInputSelectView%24DropDownListMarketMonth1=2009-07&ControlGroupAvailabilitySearchSelectView%24AvailabilitySearchInputSelectView%24DropDownListMarketDay2=28&ControlGroupAvailabilitySearchSelectView%24AvailabilitySearchInputSelectView%24DropDownListMarketMonth2=2009-07&ControlGroupAvailabilitySearchSelectView%24AvailabilitySearchInputSelectView%24DropDownListNewPassengerType_ADT=1&ControlGroupAvailabilitySearchSelectView%24AvailabilitySearchInputSelectView%24DropDownListPassengerType_INFANT=0&ControlGroupAvailabilitySearchSelectView%24AvailabilitySearchInputSelectView%24DropDownListPassengerType_CHDD=0&ControlGroupAvailabilitySearchSelectView%24AvailabilitySearchInputSelectView%24DropDownListPassengerType_CHD=0&ControlGroupAvailabilitySearchSelectView%24AvailabilitySearchInputSelectView%24DropDownListPassengerType_ADT=1&ControlGroupAvailabilitySearchSelectView%24AvailabilitySearchInputSelectView%24DropDownListMarketDateRange1=2%7C2&ControlGroupAvailabilitySearchSelectView%24AvailabilitySearchInputSelectView%24DropDownListMarketDateRange2=2%7C2&ControlGroupSelectView%24AvailabilityInputSelectView','','off');

function 
curl_login($url,$data,$proxy,$proxystatus){
    
$cookiefile $_SERVER['REMOTE_ADDR'] . '.txt';
    
$fp fopen($cookiefile"w");
    
fclose($fp);
    
$login curl_init();
    
curl_setopt($loginCURLOPT_COOKIEJAR$cookiefile);
    
curl_setopt($loginCURLOPT_COOKIEFILE$cookiefile);
    
curl_setopt($loginCURLOPT_USERAGENT$_SERVER['HTTP_USER_AGENT']);//"Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
    
curl_setopt($loginCURLOPT_TIMEOUT40);
    
curl_setopt($loginCURLOPT_RETURNTRANSFERTRUE);
    if (
$proxystatus == 'on') {
        
curl_setopt($loginCURLOPT_SSL_VERIFYHOSTFALSE);
        
curl_setopt($loginCURLOPT_HTTPPROXYTUNNELTRUE);
        
curl_setopt($loginCURLOPT_PROXY$proxy);
    }
    
curl_setopt($loginCURLOPT_URL$url);
    
curl_setopt($loginCURLOPT_HEADERFALSE);
    
curl_setopt($loginCURLOPT_HTTPHEADER, Array('Expect: '));
    
curl_setopt($loginCURLOPT_USERAGENT$_SERVER['HTTP_USER_AGENT']);
    
curl_setopt($loginCURLOPT_FOLLOWLOCATIONTRUE);
    
curl_setopt($loginCURLOPT_POSTTRUE);
    
curl_setopt($loginCURLOPT_POSTFIELDS$data);
    
ob_start();      // prevent any output
    
$ret curl_exec ($login); // execute the curl command
    
ob_end_clean();  // stop preventing output
    
curl_close ($login);
    unset(
$login);
    
    
$fp fopen($cookiefile'r');
    while (
$line fgets($fp)) {
        
$line preg_replace('/\s*#.*$/'''$line);
        if (
trim($line) == '') continue;
        
//echo $line;
        
$fields explode("\t"trim($line));
        
$host explode('.'$fields[0]);
        
//array_shift($host);
        
$host implode('.'$host);
        
//var_dump($fields);
        //setcookie($fields[5], $fields[6], $fields[4], $fields[2], $host, $fields[3] == 'TRUE');
        
header('Set-Cookie: '.rawurlencode($fields[5]).'='.rawurlencode($fields[6]).'; Domain=www.tuifly.de; Path=/'false);
    }
    
fclose($fp);
    
    return 
$ret;
}
 
function 
curl_grab_page($site,$proxy,$proxystatus){
    
$ch curl_init();
    
curl_setopt($chCURLOPT_RETURNTRANSFERTRUE);
    if (
$proxystatus == 'on') {
        
curl_setopt($chCURLOPT_SSL_VERIFYHOSTFALSE);
        
curl_setopt($chCURLOPT_HTTPPROXYTUNNELTRUE);
        
curl_setopt($chCURLOPT_PROXY$proxy);
    }
    
curl_setopt($chCURLOPT_COOKIEFILE"cookie.txt");
    
curl_setopt($chCURLOPT_URL$site);
    
ob_start();      // prevent any output
    
$ret curl_exec ($ch); // execute the curl command
    
ob_end_clean();  // stop preventing output
    
curl_close ($ch);
    return 
$ret;

Mit Zitat antworten
 


Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
 

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind aus.
[IMG] Code ist aus.
HTML-Code ist aus.

Gehe zu

Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
Externe Seite auslesen und speichern Bity PHP Grundlagen 1 17.05.2009 23:29:51
Formular: Erneutes Laden der Seite verhindern freebie HTML, CSS und JavaScript Help! 3 10.12.2008 17:55:58
Brauche Idee für Formular. c4 PHP Grundlagen 8 14.08.2007 12:47:08
Formular absenden beim laden einer Seite juergen PHP für Fortgeschrittene und Experten 18 11.06.2005 10:16:45
Formular mit php in textdatei auslesen lisa PHP Grundlagen 8 08.03.2005 18:51:53


Alle Zeitangaben in WEZ +2. Es ist jetzt 22:00:41 Uhr.


Powered by vBulletin® Version 3.8.3 (Deutsch)
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.


© 2001-2024 E-Mail SELFPHP OHG, info@selfphp.deImpressumKontakt