02.
04.
<head>
05.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=iso-8859-1"
/>
06.
<title>Untitled Document</title>
07.
</head>
08.
09.
<body>
10.
<?php
11.
12.
include
(
'C:\AppServ\simple_html_dom.php'
);
14.
$request
=
""
;
15.
$isRequestHeader
= false;
16.
17.
18.
$exHeaderInfoArr
=
array
();
19.
$exHeaderInfoArr
[] =
"Content-type: text/xml"
;
20.
$exHeaderInfoArr
[] =
"Authorization: "
.
"Basic "
.
base64_encode
(
"authen_user:authen_pwd"
);
21.
22.
$ch
= curl_init();
23.
curl_setopt(
$ch
, CURLOPT_URL,
$urlWithoutProtocol
);
24.
curl_setopt(
$ch
, CURLOPT_POST, 1);
25.
curl_setopt(
$ch
, CURLOPT_POSTFIELDS,
$request
);
26.
curl_setopt(
$ch
, CURLOPT_HEADER, ((
$isRequestHeader
) ? 1 : 0));
27.
curl_setopt(
$ch
, CURLOPT_RETURNTRANSFER, 1);
28.
if
(
is_array
(
$exHeaderInfo
) && !
empty
(
$exHeaderInfo
) )
29.
{
30.
curl_setopt(
$ch
, CURLOPT_HTTPHEADER,
$exHeaderInfo
);
31.
}
32.
$response
= curl_exec(
$ch
);
33.
curl_close(
$ch
);
34.
$html
= str_get_html(
$response
);
35.
$elem
=
$html
->find(
'table td.ms09'
, 0)->plaintext;
36.
37.
$textfile
=
"test1.txt"
;
38.
$filew
=
fopen
(
$textfile
,
'w'
);
39.
fwrite(
$filew
,
$elem
);
40.
fclose(
$filew
);
41.
42.
echo
$elem
;
43.
44.
45.
?>
46.
47.
48.
49.
</body>
50.
</html>