2013-03-19 2 views
-2

항목을 검색하면 구문 분석 오류가 표시되고이 경고를 제거하기위한 warning.how가 표시됩니다. 항목을 검색 할 때 구문 분석 오류를 표시하고 warning.how를 사용하여이 경고를 제거합니다.항목을 검색 할 때 구문 오류가 표시됩니다.

이 경고를 삭제하는 방법 & 오류가 있습니까?

Warning: simplexml_load_file() [<a href='function.simplexml-load-file'>function.simplexml-load-file</a>]: http://svcs.sandbox.ebay.com/services/search/FindingService/v1?OPERATION-NAME=findItemsAdvanced&amp;SERVICE-VERSION=1.8.0&amp;GLOBAL-ID=EBAY-US&amp;SECURITY-APPNAME=arifliaq-093e-43f2-a6ac-1e8ce8da2625&amp;keywords=110114826574&amp;paginationInput.entriesPerPage=1&amp;outputSelector=SellerInfo:1: 

parser error : Opening and ending tag mismatch: link line 1 and head in C:\wamp\www\PHP_PlaceOfferGS_TradingShopping\Browsing.php on line 39" 

코드 :

<?php 
require_once('./sessionHeader.php'); 
require_once('./SingleItem.php'); 
require_once('./keys.php'); 
error_reporting(E_ALL);   // useful to see all notices in development 
?> 

<HTML> 
<HEAD> 
<TITLE>Browsing on eBay</TITLE> 
<link rel="stylesheet" type="text/css" href="style.css" /> 
<script type="text/javascript" src="js/JQuery.js"></script> 
<script type="text/javascript" src="js/ShowDetails.js"></script> 
</HEAD> 

<BODY> 
<H1>Browsing on eBay</H1> 
<br> 

<?php 
global $shoppingURL,$appID,$eBayVersion,$findingURL,$compatabilityLevel, $findingVer; // these come from keys.php 
//need to urlencode the user-input keyword for the Finding API 
$safeQuery = urlencode($_POST['QueryString']); 
//construct the URL; we want to get only one returned item to keep things simple so set entriesPerPage to 1 
// (by default, only one page is returned) 
$apicall = "$findingURL?OPERATION-NAME=findItemsAdvanced&SERVICE-VERSION=$findingVer" 
     . "&GLOBAL-ID=EBAY-US" 
     . "&SECURITY-APPNAME=$appID" 
     . "&keywords=$safeQuery" 
     . "&paginationInput.entriesPerPage=1" 
     . "&outputSelector=SellerInfo"; 


if ($debug) { 
print"<p>$apicall</p>"; //see what call is if we're debugging-$debug comes from keys.php 
} 

// Load the call and capture the document returned by the Finding API 
$resp = simplexml_load_file($apicall); 

// Check to see if the response was loaded, else print an error 
if ($resp) { 
$results = ''; 
if ($resp->paginationOutput->totalEntries == 0) { 
    $results .= "<BR>Sorry, there were no results found\n"; 
} else { 
$results .= "<DIV ALIGN=CENTER> \n"; 
// If the response was loaded, parse it and build links 
// To keep things simple, we're showing only the first returned item; 
foreach($resp->searchResult->item as $item) { 
$browseItem = new SingleItem($resp->searchResult->item->itemId); 
$results .= $browseItem->getBrowseItemAsHTML_Table(); 
$results .= "<form name=\"BidOrBuyIt\" method=\"post\" action=\"./Login.php\" >\n"; 
$results .= "<INPUT TYPE=\"submit\" NAME=\"BidOrBuyIt\" VALUE=\"Bid or Buy It!\"> </form>\n"; 
$_SESSION['ItemID'] = (string)$browseItem->resp->Item->ItemID; // cast to string to keep in $_SESSION 
} // for each 
$results .= "</DIV> \n"; 
} 
} else { 
$results = "<BR>Sorry, did not receive a search result\n"; 
} // if $resp 
print $results; 
?> 
</BODY> 
</HTML> 
![warning][1] 
+0

나는이 오류를 제거하기 위해 노력하지만 여전히 오류가 발생합니까? – Rahil

+0

$ resp = simplexml_load_file ($ apicall); – Rahil

+0

위의 줄의 오류 – Rahil

답변

-1

편집 <br> 파일에 <br />합니다. 태그를 닫지 않으면 자주 발생합니다.

+0

나는이 파일을 시도하지만 여전히 위의 파일에서 오류가 발생했습니다 – Rahil

+0

$ resp = simplexml_load_file ($ apicall); – Rahil

+0

위의 오류는 위의 오류를 제거하는 방법 – Rahil

1

문제는 귀하의 코드가 아니라 해당 eBay URL에서 가져 오는 XML에서 발생합니다. 당신이 그것에 대해 할 수있는 일은 아무것도 없으며, 그 다음에는 ebay에 연락하여 (어떻게 든) 잘 구성된 XML을 만들 것을 요청하십시오.

가장 단순하지만 가장 나쁜 방법은 @ 억제 방법을 사용하는 것입니다.

$resp = @simplexml_load_file($apicall); 
+0

나는 이것을 시도하고 경고를 잃고 아무 항목 검색도하지 마십시오 – Rahil

+1

이것은 다른 해결책을 제시하는 최선의 해결책이 아닙니다 – Rahil

+0

이것은 해결책 ("이 경고 및 오류를 제거하는 방법"). 오류를 숨 깁니다. 코드에서 다른 논리 문제가 많아서 수정해야 할 필요가있는 이유에 대한 추가 도움을 제공하기까지해야합니다. – Uberfuzzy

관련 문제