3

我一直在为我们的计费系统编写一个模块,它工作得很好。不幸的是,API 缺少我需要立即终止服务的功能,这让我只能选择直接调用 URL...

http://www.website.com/billing/admin/clientsservices.php?userid=69264&id=68405&modop=terminate

由于模块需要在不重定向到该 URL 的情况下继续运行,我如何从我的 PHP 脚本中执行它?

4

2 回答 2

7

你可以简单地使用 file_get_contents();

<?php
file_get_contents('http://www.website.com/billing/admin/clientsservices.php?userid=69264&id=68405&modop=terminate');
?>

它会被调用。

于 2012-12-19T14:55:47.133 回答
0

为什么不直接使用 curl 将数据 POST 到 URL 而不是使用 GET?

http://php.net/manual/en/book.curl.php

于 2012-12-19T14:57:42.767 回答