开发者

using file get contents on a url that requires post data

i need to do a "file_get_contents" on a URL and there has to be data posted to the url before the contents are retrieved. is this possible? maybe something like

$cont开发者_开发技巧ents = file_get_contents($_POST"http://www.example.com/");

so that i can then work with the $contents variable?


You cannot*** POST data using file_get_contents, you must use something like cURL

* I mark this because it is actually possible taking advantage of the third parameter which uses http context(see example one). However it really isn't worth your trouble if you have something like cURL.


Ah, I have tried to do this. Simply put you can't unless you install new extra software on your sever and go through A LOT of hassel and server load.

Best bet is to use GET if at all possible!

:)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜