<?
if($shorten && $domain) {
//shorten 값 체크
$shorten_check = explode(".", $shorten);
$shorten_check2 = explode("http://", $shorten);
if(!$shorten_check[1] || !$shorten_check2[1])
alert('url이 옳지 않습니다.');
//사용가능 도메인인가
$domain_check = '0';
for($i=0;$i<count($cf_domain);$i++){
if ($domain == $cf_domain[$i])
$domain_check = '1';
}
if($domain_check != '1')
alert('존재하지 않는 도메인 입니다.');
62라인 ----> $data=mysql_fetch_array(mysql_query("select id from $cf_table where move_page='$shorten' AND url='$domain' AND type='2'"));
if(!$data) {
64라인----> $tmp=mysql_fetch_array(mysql_query("select max(wr_id) as max_wr_id from $cf_table where url='$domain' AND type='2'"));
65라인 ㅡㅡ> $tmp=mysql_fetch_array(mysql_query("select id from $cf_table where wr_id='$tmp[max_wr_id]'"));
$data['id'] = trim(num_text_up($tmp['id']));
$today = date("Y-m-d", time());
$user_ip = $_SERVER['REMOTE_ADDR'];
$user_ip = trim($user_ip);
$insert_check = @mysql_query("insert into $cf_table (mb_id,id,url,visit,move_page,create_time,set_time,type) values ('$user_ip','$data[id]','$domain','아직 방문기록이 없습니다.','$shorten','$today','$today','2')");
if(!$insert_check)
alert('도메인 포워딩등록 실패했습니다.\n\n다시시도 해주세요');
}