Hi,
ich habe ein PHP-Skript, das eine andere Webseite mit Curl
aufrufen soll. Eine URL, um mit GET Daten zu übertragen baut
sich das Skript und wenn man die im Browser aufruft, kommt
auch raus, was rauskommen soll. Wenn man sie hingegen im
Skript mit Curl aufruft, scheint Curl (laut Wireshark)
sämtliche &-Zeichen durch & a m p ; zu ersetzen. Das
funktioniert dann natürlich nicht mehr.
DIe Frage ist nur: Wieso? Und was tut man dagegen?
wäre nett wenn du mal so irgentwie sachst wie du dein CURL einsetzt, immerhin sieht hier keiner dein Befehl
hier mal ein auszug aus der syntax
-d/--data
(HTTP) Sends the specified data in a POST request to the HTTP server, in the same way that a browser does when a user has filled in an HTML form and presses the submit button. This will cause curl to pass the data to the server using the content-type application/x-www-form-urlencoded. Compare to -F/--form.
-d/--data is the same as --data-ascii. To post data purely binary, you should instead use the --data-binary option. To URL-encode the value of a form field you may use --data-urlencode.
If any of these options is used more than once on the same command line, the data pieces specified will be merged together with a separating &-symbol. Thus, using '-d name=daniel -d skill=lousy' would generate a post chunk that looks like 'name=daniel&skill=lousy'.
If you start the data with the letter @, the rest should be a file name to read the data from, or - if you want curl to read the data from stdin. The contents of the file must already be URL-encoded. Multiple files can also be specified. Posting data from a file named 'foobar' would thus be done with --data @foobar.
--data-binary
(HTTP) This posts data exactly as specified with no extra processing whatsoever.
If you start the data with the letter @, the rest should be a filename. Data is posted in a similar manner as --data-ascii does, except that newlines are preserved and conversions are never done.
If this option is used several times, the ones following the first will append data as described in -d/--data.
--data-urlencode
(HTTP) This posts data, similar to the other --data options with the exception that this performs URL-encoding. (Added in 7.18.0)
To be CGI-compliant, the part should begin with a name followed by a separator and a content specification. The part can be passed to curl using one of the following syntaxes:
content
This will make curl URL-encode the content and pass that on. Just be careful so that the content doesn't contain any = or @ symbols, as that will then make the syntax match one of the other cases below!
=content
This will make curl URL-encode the content and pass that on. The preceding = symbol is not included in the data.
name=content
This will make curl URL-encode the content part and pass that on. Note that the name part is expected to be URL-encoded already.
alles klar : http://curl.haxx.se/docs/manpage.html
oder hast du nur copy und paste und weist garnicht was CURL ist ?? sieht jedenfals so aus wenn ich deine Frege mal so anschaue und die erstens 2 seiten der manpage .
LG
ventrue