简体   繁体   English

打开一个没有重定向的PHP页面?

[英]Open a PHP Page without redirect?

I have been writing a module for our billing system at work, and it works beautifully. 我在工作中为我们的计费系统编写了一个模块,它的工作非常精彩。 Unfortunately the API lacks a function that I need to terminate services immediately leaving me with the only option of calling the URL directly at... 不幸的是,API缺少一个我需要立即终止服务的功能,让我只能直接调用URL ...

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

As the module needs to continue to run without redirecting to that URL, how can I execute that from my PHP script? 由于模块需要继续运行而不重定向到该URL,我如何从我的PHP脚本执行该操作?

You could simply use file_get_contents(); 你可以简单地使用file_get_contents();

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

And it will be called. 它将被称为。

Why not just use curl to POST the data to the URL instead of using GET? 为什么不使用curl将数据发布到URL而不是使用GET?

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM