<?php
    $qry = $_GET["qry"];
  
if ( get_magic_quotes_gpc() ) {
    $_GET = array_map('stripslashes',$_GET);
    $_POST = array_map('stripslashes',$_POST);
    $_COOKIE = array_map('stripslashes',$_COOKIE);
}
  require_once("../db.php");
 // echo "SELECT * FROM MEMBER WHERE MACCOUNT='$qry'" ;
 $res = oci_parse($conn,"SELECT * FROM MEMBER WHERE MACCOUNT='$qry'") or die('Insert error');
oci_execute($res);
 /*
    $sql_stmt = "SELECT COUNT(*) AS num_rows FROM ".$tbName1." WHERE mAccount='".$qry."' ORDER BY mId DESC";
    $res = $my_sql->query_exec($sql_stmt,"4");
    $row = $res[0]['num_rows'];
   */
   $row=oci_fetch_all($res,$result) ;
    $str1 = '此帳號已被使用';
    $str2 = '此帳號可以註冊';
   
    $url = "login_check.php?qry=".$qry;
    header("Refresh: 1; URL=\"$url\""); 
    
    if($row>0)
    {
      $result="[{'check':'NULL','content':'此帳號已被使用'}]";
	  echo $result;
//	  echo '<font color=red>'.$str1.'</font>';

    }
    else
    {$result="[{'check':'ok','content':'此帳號可以註冊'}]";
	
	 echo $result;
      //echo $str2;
    }
  
?>