<?php
function get_external_ip(){
$ch = curl_init("http://checkip.dyndns.org:8245/");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, "").
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
return $output;
}
echo get_external_ip();
?>
แล้วเอาไปวางใน WebServer ตัวที่ต้องการ แล้วมาเรียกไฟล์ php นี้ให้ทำงานผ่าน WebBrowser เท่านี้ก็เรียบร้อยจ้า..
0 ความคิดเห็น