Warning: Undefined array key "mobile_dir" in /home/kagla/new-sir/old/common.php on line 315
팁문의 일본내에서 접속하면

팁문의 일본내에서 접속하면

팁문의 일본내에서 접속하면

QA

팁문의 일본내에서 접속하면

답변 2

본문

일본내에서 마이사이트.com 접속했을때 다른 너의사이트.com 도메인으로 접속되게 하려는데

[넘기려고하는데]

 

아래와 같은 소스가 있는데

 

이걸 head.sub.php에 넣어도 되는지요?

 

 

이런방법이 가능한지요 문의드립니다.

 

 

<?php
   
   $server   = ''; // MySQL hostname
   $username = ''; // MySQL username
   $password = ''; // MySQL password
   $dbname   = ''; // MySQL db name
   
   
   $db = mysql_connect($server, $username, $password) or die(mysql_error());
         mysql_select_db($dbname) or die(mysql_error());
         
   $sql = 'SELECT
               country
           FROM
               ip2nation
           WHERE
               ip < INET_ATON("'.$_SERVER['REMOTE_ADDR'].'")
           ORDER BY
               ip DESC
           LIMIT 0,1';
   
   list($country) = mysql_fetch_row(mysql_query($sql));
   
   switch ($country) {
      case 'se':
         // Get the Swedish to a Swedish newssite
         header('Location: http://www.thelocal.se/');
         exit;
      case 'us':
         // And redirect US visitors to CNN
         header('Location: http://www.cnn.com/');
         exit;
      default:
         // The rest of the world can go to BBC
         header('Location: http://www.bbc.co.uk/');
         exit;
   }
   
?>  

이걸 봐도 방법을 모르겠네요.

이 질문에 댓글 쓰기 :

답변 2

그누보드에서 사용하실거면

   $server   = ''; // MySQL hostname
   $username = ''; // MySQL username
   $password = ''; // MySQL password
   $dbname   = ''; // MySQL db name
   
   
   $db = mysql_connect($server, $username, $password) or die(mysql_error());
         mysql_select_db($dbname) or die(mysql_error());

이 부분을 삭제하시고 

list($country) = mysql_fetch_row(mysql_query($sql)); 이 부분을 아래로 바꿔 시도해 보시죠.

$r = sql_fetch($sql);

$country = $r['country'];

 

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 129,406
© SIRSOFT
현재 페이지 제일 처음으로