PHP: http_post_fields - Manual

downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

http_put_data http_post_data

Last updated: Fri, 26 Jan 2007

view this page in

# http_post_fields

(PECL)

http_post_fields -- Perform POST request with data to be encoded

## Описание

string http_post_fields ( string url [, array data [, array files [, array options [, array &info]]]] )

Performs an HTTP POST request on the supplied url.

See http_get() for a full list of available parameters and options.

## Список параметров

`url`

  URL

`data`

  Associative array of POST values

`files`

  Array of files to post

`options`

  Request options

`info`

  Request/response information

## Возвращаемые значения

Returns the HTTP response(s) as string on success, or FALSE on failure.

add a note User Contributed Notes
http_post_fields
thomasxholder at compuserve dot de
07-Jan-2007 03:21
`It was hard to figure out how to actually post files with this function. The "Array of files to post" is an array of associative arrays, each need the keys "name", "type" and "file". Consider this example code:
<?php
$files = array(
array(
'name' => 'somename',
'type' => 'text/plain',
'file' => $filename
)
);
$http_response = http_post_fields($url, $data, $files);
?>`
add a note
http_put_data http_post_data

Last updated: Fri, 26 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 09:32:46 2007 PST