Path: csiph.com!usenet.pasdenom.info!news.albasani.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Date: Sat, 16 Jun 2012 20:46:04 +0200 From: Luuk User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120604 Thunderbird/13.0 MIME-Version: 1.0 Newsgroups: comp.lang.php Subject: Re: Simulating a Form Method=Post submission in PHP References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <6s0va9-ugd.ln1@luuk.invalid.lan> Lines: 23 NNTP-Posting-Host: 2001:980:9089:1:59cd:48e:fd8b:36a1 X-Trace: 1339872601 news.xs4all.nl 6894 [2001:980:9089:1:59cd:48e:fd8b:36a1]:34218 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.php:6348 On 16-06-2012 20:25, Robert Rosenberg wrote: > I would like to go to an external site and send a form to it via Post > (simulating having generated the form and having the user submit it). I know > that if I had been using GET, I could just code the parms along with the URL > in the location command. To simulate Post I assume that I just need to use > header to send the POST parms but I do not know the format of what to place > in the header request (and I assume that I then use location to fire off to > connection). > > Can someone either supply me with a sample code to do this or give me the > URL of the documentation of the Headers that get sent by Post so I can look > them up and create the needed script myself. > > Thank You. > use curl (example #2) see: http://www.php.net/manual/en/function.curl-setopt.php or file_get_contents see: http://www.php.net/manual/en/function.file-get-contents.php#108309