|
Posted by HC on 06/12/06 21:13
Hi Sjoerd,
Your example runs, but 'foo' and 'beer' seem to be standard form inputs
- they don't appear to simulate a file upload. The script I am
submitting to looks for data from $_FILES - unfortunately, I have no
control over this.
If you have any other ideas, that would be spectacular.
HC
Sjoerd wrote:
> <?php
>
> $post_data = array();
>
> $post_data['foo'] = "bar";
> $post_data['beer'] = "good";
>
>
> $ch = curl_init();
> curl_setopt($ch, CURLOPT_URL, "http://my.domain.com/my_url.php" );
> curl_setopt($ch, CURLOPT_POST, 1 );
> curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
> $postResult = curl_exec($ch);
>
> if (curl_errno($ch)) {
> print curl_error($ch);
> }
> curl_close($ch);
> print "$postResult";
> ?>
>
Navigation:
[Reply to this message]
|