function webget($url) {
$handle = curl_init($url);
curl_setopt ($handle, CURLOPT_HEADER, 0);
curl_setopt ($handle, CURLOPT_USERAGENT, "User-Agent: SMI (Mozilla Compatible)");
//curl_setopt ($handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($handle, CURLOPT_CONNECTTIMEOUT, 120);
curl_setopt ($handle, CURLOPT_TIMEOUT, 120);
ob_start();
curl_exec($handle);
curl_close($handle);
$contents = ob_get_contents();
ob_end_clean();
return $contents;
}
$host_name="localhost"; // mysql 서버의 주소
$user_name="self"; // mysql 사용자 아이디
$user_passwd="self321"; // mysql 사용자 패스워드
$db_name="self"; // mysql 디비 이름
$connect = mysql_connect("$host_name","$user_name","$user_passwd")
or die("Could not connect: " . mysql_error());
mysql_select_db($db_name, $connect) or die ('Can\'t use music : ' . mysql_error());
mysql_query("set names utf8;",$connect);
setlocale(LC_CTYPE, 'ko_KR.UTF-8');
$id=$_SERVER["QUERY_STRING"];
$query = "select server, port FROM self where id = '$id'";
$result = mysql_query ($query, $connect)
or die("Invalid query1: " . mysql_error());
if(mysql_num_rows($result) == 1) {
$row = mysql_fetch_array($result);
} else {
echo "
요청URL에 문제가 있습니다. 서비스문의게시판에 문의바랍니다.