|
Posted by tony on 06/08/06 09:34
In article <44870369$0$22925$ed2619ec@ptn-nntp-reader01.plus.net>,
tomhartlandREMOV@ETHISgmail.com says...
>
> <tony@tony.com> wrote in message
> news:MPG.1ef0bd3b934f949c9898c5@news-text.blueyonder.co.uk...
> >
> > Is it possible to use the post method to send a form from PHP without
> > having to put the form in a html page?
>
> Unless I've failed to understand what you're after, you could use the CURL
> library.
> It allows you to call any web page (not necessarily a PHP page) from within
> your PHP.
> Make sure the "extension=php_curl.dll" is uncommented in your PHP.ini.
>
> Something like this (which uses buffering to stop the returned web page
> being displayed)...
> ob_start();
> $ch = curl_init('https://www.mysite.com/cgi/incoming.php');
> curl_setopt( $ch, CURLOPT_POST, true );
> curl_setopt( $ch, CURLOPT_POSTFIELDS, 'data01=12&data02=rejected');
> curl_exec($ch);
> $getinfo_results = curl_getinfo($ch);
> curl_close( $ch );
> $return_page = ob_get_contents();
> ob_end_clean();
>
> "$getinfo_results" will give an array of information telling you if the page
> request was successful or not, and "$return_page" will contain the full HTML
> of the request.
>
> Tom
>
>
>
Hi Tom - I think you do get the idea (from your buffering comment)
I've never heard of curl (I'm just getting over wasting loads of my time
with that pear rubbish)
I'll take a look at curl (assuming my service provider allows its use -
these people are very daft about what they do and dont allow sometimes)
thanks for the idea
tony
Navigation:
[Reply to this message]
|