我想从 url 读取 XML 文件,然后从我的 XML 文件中检索信息。
<?php
if( $_POST["name"])
{
ini_set('allow_url_fopen ','ON');
$completeurl = "http://localhost:8983/solr/select?q=".$_POST['name'];
$xml = simplexml_load_file(file_get_contents($completeurl));
exit();
}
?>
<html>
<body>
<form action="<?php $_PHP_SELF ?>" method="POST">
Search: <input type="text" name="name" />
<input type="submit" />
</form>
</body>
</html>
当我在表单中写一些输入时,它显然设法检索到一些东西,但我也收到这样的消息:
Warning: simplexml_load_file() [function.simplexml-load-file]:
I/O warning : failed to load external entity "<?xml version="1.0" encoding="UTF-8"?>
<response> <lst name="responseHeader"><int name="sta....
如何从 url 中提取 xml-info?