私は、次のエラーメッセージを取得しておくのXPath検索PHP
Notice: Undefined index: txtSearch in /var/www/vhosts/numyspace.co.uk/web_users/home/~unn_w11023553/public_html/holiday/searchprocess.php on line 11
Warning: SimpleXMLElement::xpath() [simplexmlelement.xpath]: Invalid expression in /var/www/vhosts/numyspace.co.uk/web_users/home/~unn_w11023553/public_html/holiday/searchprocess.php on line 22
Warning: SimpleXMLElement::xpath() [simplexmlelement.xpath]: xmlXPathEval: evaluation failed in /var/www/vhosts/numyspace.co.uk/web_users/home/~unn_w11023553/public_html/holiday/searchprocess.php on line 22
Warning: Invalid argument supplied for foreach() in /var/www/vhosts/numyspace.co.uk/web_users/home/~unn_w11023553/public_html/holiday/searchprocess.php on line 26
Title
その後、私は私の検索ファイルを実行しよう
<?php
include('functions.php');
$header = makeHeader();
// create an instance
$holidayDoc = simplexml_load_file('http://numyspace.co.uk/~unn_w11023553/holiday/holidays.xml');
// set $studytype to either the upper case request or null
$txtSearch = $_GET["txtSearch"];
// set the query using the studytype
if (!is_null($txtSearch)) {
$qry = "//channel/item[description[contains(text(),\"$txtSearch\")]]";
}
else {
// blank search entered so all holidays are shown.
$qry = "/channel/'ALL'";
}
$holidays = $holidayDoc->xpath($qry); // do the xpath query LINE 17
// now loop through all the students
echo "<table border=\"1\">\n";
echo "<tr><td>Title</td></tr>\n";
foreach ($holidays as $holiday) //LINE 21
{
echo
echo <p><strong><a href = '$link'>'$holiday'</a></strong></p>
<p><small>$published</small></p>";
}
$footer = makeFooter();
?>
はまだおよそ2時間とするために、それをいじるされて 私はどこに間違って行ったことができない、どのような洞察力が大変感謝します、ありがとう。