Search for "Rasmus Lerdorf" and "posttohost" in your fave PHP code archive
or search engine.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: "Alexis Michel Golzman" <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Sunday, February 25, 2001 2:47 AM
Subject: [PHP] How do I submit a POST form?


> 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]
>


-- 
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]

Reply via email to