내가 지금 얼마 동안이 스크립트 http://komunitasweb.com/2009/09/showing-the-weather-with-php-and-google-weather-api/를 사용하고 구글 날씨 API를 사용하는 데 문제가 있지만 이전이 오류를 가지고 :구글 날씨 API를 문제
Warning: simplexml_load_file() [function.simplexml-load-file]: //www.google.com/ig/api?weather=bermuda:2: parser error : Opening and ending tag mismatch: meta line 1 and HEAD in /home/webmx04/public_html/weather/widgetlive1.php on line 3
Warning: simplexml_load_file() [function.simplexml-load-file]: 302 Moved in /home/webmx04/public_html/weather/widgetlive1.php on line 3
Warning: simplexml_load_file() [function.simplexml-load-file]:^in /home/webmx04/public_html/weather/widgetlive1.php on line 3
Warning: simplexml_load_file() [function.simplexml-load-file]: //www.google.com/ig/api?weather=bermuda:6: parser error : Opening and ending tag mismatch: HEAD line 1 and HTML in /home/webmx04/public_html/weather/widgetlive1.php on line 3
Warning: simplexml_load_file() [function.simplexml-load-file]: in /home/webmx04/public_html/weather/widgetlive1.php on line 3
Warning: simplexml_load_file() [function.simplexml-load-file]:^in /home/webmx04/public_html/weather/widgetlive1.php on line 3
Warning: simplexml_load_file() [function.simplexml-load-file]: //www.google.com/ig/api?weather=bermuda:7: parser error : Premature end of data in tag HTML line 1 in /home/webmx04/public_html/weather/widgetlive1.php on line 3
Warning: simplexml_load_file() [function.simplexml-load-file]: in /home/webmx04/public_html/weather/widgetlive1.php on line 3
Warning: simplexml_load_file() [function.simplexml-load-file]:^in /home/webmx04/public_html/weather/widgetlive1.php on line 3
Fatal error: Call to a member function xpath() on a non-object in /home/webmx04/public_html/weather/widgetlive1.php on line 4
사람이 내가 당신에게
감사 도와 드릴까요 내 코드 :
<?
$xml = simplexml_load_file('http://www.google.com/ig/api?weather=bermuda');
$information = $xml->xpath("/xml_api_reply/weather/forecast_information");
$current = $xml->xpath("/xml_api_reply/weather/current_conditions");
$forecast_list = $xml->xpath("/xml_api_reply/weather/forecast_conditions");
?>
<html>
<head>
<title>Google Weather API</title>
</head>
<body>
<div id="widget-wrapper"><!-- start widget-wrapper-->
<div class="weather"><!-- start weather-->
<h2><a href="/section/weather" title="More on Weather" target="_top">Current Weather</a></h2>
<a href="/section/weather" target="_top"><img src="<?= 'http://www.rgbdahosting.com' . $current[0]->icon['data']?>" alt="More on Weather"?></a>
<span class="condition">
<a href="/section/weather" title="More on Weather" target="_top"><H4><?= $current[0]->temp_f['data'] ?>°F</H4>
<p><?= $current[0]->condition['data'] ?></p></a>
</span>
</div><!-- end weather-->
</div> <!-- end widget-wrapper-->
</body>
태그가 일치하지 않는 소스를 참조하십시오. 부적절한 장소에서 태그가 닫히거나 닫히지 않는다는 것을 의미합니다. –
답장을 보내 주셔서 감사합니다. 위의 코드로 불일치하는 것이 무엇을 의미합니까? 내가 잘못하고있는 것을 볼 수 있습니까? , http://komunitasweb.com/2009/09/showing-the-weather-with-php-and-google-weather-api/의 데모가 잘 작동하는지 잘 모르겠지만 붙여 넣기를 복사하면됩니다. 그것은 내 호스팅에 그냥 오류가 – Brian
그것은 자체가 해결 됐어 무슨 일이 있었는지 우둔 해요 – Brian