Hi,
I've submitted many times a GET form like this:
header("Location:
http://examplesite.com/myscript.php3?key=value&key2=value2&keyn=valuen");
but now I need to submit a POST form.
How is this done?
I found this Perl code on the web:
--------------------------------------------------------------
use strict;
use LWP::UserAgent; # libwww-perl
my $ua = new LWP::UserAgent or die "new UA: $!";
$ua->agent("testclient/1.0");
my $url = 'http://localhost/cgi-bin/test.pl';
my $request = new HTTP::Request('POST', $url) or
die "new HTTP::Request POST '$url': $!";
$request->content_type('application/x-www-form-urlencoded');
$request->content('field1=value1&field2=value2&field3=value3');
#$request->content('field1=value1'); # optional method
#$request->add_content('&field2=value2');
#$request->add_content('&field3=value3');
my $response = $ua->request($request);
print $response->content;
--------------------------------------------------------------
But I want to know if there is a way of doing it in PHP...
Thanks in advance for your help! :-)
Kind regards,
Alexis Golzman
mailto:[EMAIL PROTECTED]
http://trafficbar.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]