Re: Simulating POST

From: Date: Sat, 14 Sep 2002 00:41:42 +0000
Subject: Re: Simulating POST
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-116340@lists.php.net to get a copy of this message
This looks to be similar to what another poster suggested, which is basically to make your own socket connection. While this is actually the approach I take, it is not something I would recommend. The socket extension is still marked experimental (though there is a new maintainer that appears to be working very hard to stabilize it soon), and this approach requires a decent knowledge of HTTP, which unfortunately a lot of Web developers still lack. A better alternative for most people is going to be looking into the Curl extension. Another poster mentioned some example code on Paypal's Web site, but I'm not sure what that example consisted of. Maybe someone who uses Curl regularly could post a simple example of posting data to a remote resource? Happy hacking. Chris Alex Shi wrote:
I would believe what he wants is to embed post into an URL. And I guess this might be what he implied by "simulate".. I myself don't know very much about the trick but happen to get an example from: $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; $header .= 'Content-Length: ' . strlen($req) . "\r\n\r\n"; Hope this can help. Alex "Jesse Cablek" <php@list.everchanging.org> wrote in message news:006101c25b84$6978a480$4550500a@cablek.net...
David Duong <mailto:davidduong1@hotmail.com> scribbled;
How can I simulate a POST (from HTML forms) request?
     
<form method="post" action="script.php"> <input ... /> </form> -jesse


« previous php.general (#116340) next »