Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试为我的 rss 创建身份验证
require_once "RSS.php"; $rss =& new XML_RSS("http://localhost/rss_server/rssdata.php");
上面的 url 拉取提要。我希望通过身份验证知道哪个用户正在访问 RSS url,并且只有真正的用户才能访问 RSS 提要。
我试过http认证。但它不起作用,当我尝试直接访问该 url 时,它显示了一个身份验证提示。
谁能帮我吗...
您需要将用户名和密码传递给 php 文件,检查信息,如果正确则输出 RSS
它是这样的:
if (isset($_REQUEST['username']) && isset ($_REQUEST['password'])) { if ( user_exists($_REQUEST['username'], $_REQUEST['password']) ) { echo outputRSS(); } }
但是您必须考虑(或向我们提供更多信息)如何将这些详细信息发送到 php 脚本。