php curl senden vars per GET wierd Ergebnisse

bin ich versucht, rufen Sie eine url in einer Seite auf eine remote-site. Beschlossen auf der Verwendung von curl. Auf der remote-site die url vars zu zeigen, wie:

$_REQUEST   Array
(
    [var1] => val1
    [amp;var2] => val2
    [amp;var3] => val3
)

die url aufgerufen wird:

http://site.com/controller/action.php?var1=val1&var2=val2&var3=val3

Bemerken, dass ich nicht mit & in der url, aber die Anfrage global hat es, oder fast - es hat amp; statt & und nicht & wie ich früher!!! Nicht, dass es sollte keine von Ihnen.

Curl-Objekt angemeldet hat, um ein Formular, das setzen von cookies, veröffentlicht ein Formular auf einer anderen Seite, und dies ist jetzt der Letzte link, den ich Folgen müssen.

hier ist die php verwende ich:

    curl_setopt($this->ch, CURLOPT_URL, "http://site.com/controller/action.php?var1=val1&var2=val2&var3=val3");
    curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($this->ch, CURLOPT_REFERER, "http://site.com/");
    curl_setopt($this->ch, CURLOPT_VERBOSE, 1);
    curl_setopt($this->ch, CURLOPT_COOKIEJAR, $this->cookie);
    curl_setopt($this->ch, CURLOPT_COOKIEFILE, $this->cookie);
    curl_setopt($this->ch, CURLOPT_POST, 0);
    curl_setopt($this->ch, CURLOPT_HTTPGET, 1);
    $output = curl_exec($this->ch);
    $info = curl_getinfo($this->ch);

Ich habe lief eine andere curl-Anfrage nach diesem und ich bin immer noch angemeldet, so Problem ist nicht cookies. Da die Letzte Anfrage (login-form) verwendet, $_POST, haben gesetzt haben, CURLOPT_POST, 0 und die CURLOPT_HTTPGET zu 1.
Hier ist die Ausgabe von $info:

info    Array
(
    [url] => http://site.com/controller/action.php?var1=val1&var2=val2&var3=val3
    [content_type] => text/html; charset=utf-8
    [http_code] => 403
    [header_size] => 403
    [request_size] => 541
    [filetime] => -1
    [ssl_verify_result] => 0
    [redirect_count] => 0
    [total_time] => 0.781186
    [namelookup_time] => 3.7E-5
    [connect_time] => 3.7E-5
    [pretransfer_time] => 4.2E-5
    [size_upload] => 1093
    [size_download] => 3264
    [speed_download] => 4178
    [speed_upload] => 1399
    [download_content_length] => 3264
    [upload_content_length] => 0
    [starttransfer_time] => 0.781078
    [redirect_time] => 0
    [certinfo] => Array
        (
        )

)

wenn ich copy & past $info['url'] in den browser funktioniert es. Völlig verloren, Stunden verloren auf der Uhr, jede Hilfe wäre willkommen 😉

  • .... die http-403 geschieht aus meinem code, da $var2 nicht gefunden wird in der $_GET[] oder $_REQUEST[]
InformationsquelleAutor Daithí | 2012-04-19
Schreibe einen Kommentar