在 PHP 中使用 HTAUTH 访问 xml feed

发布于 2024-09-17 10:19:36 字数 455 浏览 3 评论 0原文

如何在 PHP 中使用 HAUTH 访问 xml feed?

虚拟链接格式为 http://username:[email protected]/www.domain.com/trends/001.xml

我正在使用下面的代码来访问它。

$doc = new DOMDocument();
$doc->load($source);

提前致谢, 蒸汽男孩

How can I access a xml feed with HAUTH in PHP?

Dummy link format is http://username:[email protected]/www.domain.com/trends/001.xml

I'm using the code below to access it.

$doc = new DOMDocument();
$doc->load($source);

Thanks in advance,
steamboy

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

暖心男生 2024-09-24 10:19:36

您可以尝试使用curl来获取受密码保护的文件的内容。这是一个使您能够轻松获取该数据的类: http:// /de.php.net/manual/en/book.curl.php#90821

您需要在curl中设置CURLOPT_USERPWD选项来进行密码保护。

You might try to use curl to get the content of the password protected file. Here is a class that enables you to easily get that data: http://de.php.net/manual/en/book.curl.php#90821

You need to set the CURLOPT_USERPWD option in curl for the password protection.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文