Re: HTTP post requests

From: Date: Mon, 05 Feb 2001 14:48:20 +0000
Subject: Re: HTTP post requests
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-38239@lists.php.net to get a copy of this message
Greetings, first of all you'll need to have all of your variables in one line: like this for example $vars="var1=".urlencode($var1)."&var2=".urlencode($var2); then you need to post the following $header="POST /your_script.php HTTP/1.0\r\nContent-length: ".strlen($vars)\r\n\r\n$vars\r\n\r\n"; echo $header Of course these are not the complete headers browser sends, HTH, -- Vahan Yerkanian Email: vahan@design.am Leading Web Developer / Designer Phone: (374) 158-2723 Web Development Department Fax: (374) 128-5082 ARMINCO Global Telecommunications http://www.arminco.com Matthew Brealey wrote: > > I need to do an HTTP post from a PHP script; I want to set username=xxxx. > > What is the correct way to do this in PHP? > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#38239) next »