Jeff Oien wrote:
Thanks for the helpful examples. One other question. Is there an
advantage to sending the URL via a header as opposed to doing http_post
like this?
http://shiflett.org/hacks/php/http_post
Jeff
As mentioned a couple of times, size is one. But you still need to
url-encode the data if you're going to send it via post.
<?php
$data = array('item1' => 'value1', 'item2' => 'value2');
$query_string = http_build_query($data);
// Now, you can send the data either via post:
$response = http_post('www.example.com', '/form.php', $data);
// ...or via get:
header('http://www.example.com?form.php?' . $data);
?>
The first lets your script grab the output of the form to which
you're submitting (it's in $response after the http_post() call);
the second actually loads and displays the target form.
Another option is cURL, which is designed for exactly this sort
of thing:
http://www.php.net/curl
...but it may or may not be overkill for what you need. However,
cURL pretty much rules the data posting/fetching game as far as
configurability etc.
Cheers,
Torben <[EMAIL PROTECTED]>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php