api 고수님들 도와주세요 채택완료
워크넷API 채용정보를 구축중인데요
https://openapi.work.go.kr/opi/opi/opia/wantedApiDetailVw.do
위 부분을 적용하려는데
제 소스는
-----------------------------------------------------------------------------------------------
<!-- mainSection -->
<div style="font-size:17px">
<?
// 채용정보 url
$url = "http://openapi.work.go.kr/opi/opi/opia/wantedApi.do";
// 채용정보 각각의 요청변수들 - 광주광역시, 15개불러오기, 고령자
$var = "authKey=[인증키]&callTp=D&returnType=XML
&wantedAuthNo=[구인인증번호]&infoSvc=VALIDATION";
$data = file_get_contents($url . $var);
$xml = simplexml_load_string($data);
// 전체적인 내용 출력
echo "<pre>";
print_r($xml);
echo "</pre>";
?>
</div>
<!-- //mainSection -->
--------------------------------------------------------------------------------------
이렇게 하고 소스를 실행하면
Warning: simplexml_load_string() [https://www.kyungbiwon.com/sub_con/function.simplexml-load-string">function.simplexml-load-string]: Entity: line 102: parser error : StartTag: invalid element name in /host/home2/kyungbiwon/html/sub_con/apii.php on line 29
Warning: simplexml_load_string() [https://www.kyungbiwon.com/sub_con/function.simplexml-load-string">function.simplexml-load-string]: if (limSizeLst[1] < newFontSize) newFontSize = limSizeLst[1]; in /host/home2/kyungbiwon/html/sub_con/apii.php on line 29
Warning: simplexml_load_string() [https://www.kyungbiwon.com/sub_con/function.simplexml-load-string">function.simplexml-load-string]: ^ in /host/home2/kyungbiwon/html/sub_con/apii.php on line 29
Warning: simplexml_load_string() [https://www.kyungbiwon.com/sub_con/function.simplexml-load-string">function.simplexml-load-string]: Entity: line 103: parser error : StartTag: invalid element name in /host/home2/kyungbiwon/html/sub_con/apii.php on line 29
Warning: simplexml_load_string() [https://www.kyungbiwon.com/sub_con/function.simplexml-load-string">function.simplexml-load-string]: if (newFontSize < limSizeLst[0]) newFontSize = limSizeLst[0]; in /host/home2/kyungbiwon/html/sub_con/apii.php on line 29
Warning: simplexml_load_string() [https://www.kyungbiwon.com/sub_con/function.simplexml-load-string">function.simplexml-load-string]: ^ in /host/home2/kyungbiwon/html/sub_con/apii.php on line 29
Warning: simplexml_load_string() [https://www.kyungbiwon.com/sub_con/function.simplexml-load-string">function.simplexml-load-string]: Entity: line 311: parser error : EntityRef: expecting ';' in /host/home2/kyungbiwon/html/sub_con/apii.php on line 29
Warning: simplexml_load_string() [https://www.kyungbiwon.com/sub_con/function.simplexml-load-string">function.simplexml-load-string]: remote = window.open("https://www.eprivacy.or.kr:40018/seal/mark.jsp?mark=e&code in /host/home2/kyungbiwon/html/sub_con/apii.php on line 29
Warning: simplexml_load_string() [https://www.kyungbiwon.com/sub_con/function.simplexml-load-string">function.simplexml-load-string]: ^ in /host/home2/kyungbiwon/html/sub_con/apii.php on line 29
Warning: simplexml_load_string() [https://www.kyungbiwon.com/sub_con/function.simplexml-load-string">function.simplexml-load-string]: Entity: line 339: parser error : Entity 'copy' not defined in /host/home2/kyungbiwon/html/sub_con/apii.php on line 29
Warning: simplexml_load_string() [https://www.kyungbiwon.com/sub_con/function.simplexml-load-string">function.simplexml-load-string]: <p><img src="/images/common/layout/copyright.gif" alt="Copyright © 고용 in /host/home2/kyungbiwon/html/sub_con/apii.php on line 29
Warning: simplexml_load_string() [https://www.kyungbiwon.com/sub_con/function.simplexml-load-string">function.simplexml-load-string]: ^ in /host/home2/kyungbiwon/html/sub_con/apii.php on line 29
Warning: Invalid argument supplied for foreach() in /host/home2/kyungbiwon/html/sub_con/apii.php on line 37
----------------------------------------------------------------------------------------------------
이렇게 에러가 발생합니다
고수님들 해결부탁드립니다
답변 4개
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
$data = file_get_contents($url . $var);
echo $data;
// 하셔서 브라우저에서 소스 보기로 xml 데이터가 잘 나오는지 확인해 보세요.
댓글을 작성하려면 로그인이 필요합니다.
혹시나 하는 질문인데
$var = "authKey=[인증키]&callTp=D&returnType=XML
&wantedAuthNo=[구인인증번호]&infoSvc=VALIDATION";
위의 [인증키] , [구인인증번호] 는 실제값을 넣고 작동시킨거죠?
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
제가 초보라 어떻게 소스를 추가해야 할지
조금 자세하게 설명 부탁드립니다