I want to read a XML-file from an url and then retrieve the information from my XML-file.
<?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>
When I write some input to the form, it clearly manages to retrieve something, but I also get a message like this:
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....
How can I extract the xml-info from the url?