/home/mjc1/public_html/manage/ajax.cs3_manual_cate.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
include("./category/common.php");

@
extract($_POST);


if(
$mode==2){
    
$sql "select * from cs3_manual_cate2 where substring(code,1,2) = '{$cate1}' ";
    
$res mysql_query($sql);
    
$xml1 ""$xml2 "";
    while(
$info=mysql_fetch_array($res)){
        
$info['name'] = iconv("euckr","utf-8",$info['name']);
        
$xml1 .= "<opt_code>{$info['code']}</opt_code>";
        
$xml2 .= "<opt_name>{$info['name']}</opt_name>";
    }
} else if(
$mode==3){
    
$sql "select * from cs3_manual_cate3 where substring(code,1,4) = '{$cate2}' ";
    
$res mysql_query($sql);
    
$xml1 ""$xml2 "";
    while(
$info=mysql_fetch_array($res)){
        
$info['name'] = iconv("euckr","utf-8",$info['name']);
        
$xml1 .= "<opt_code>{$info['code']}</opt_code>";
        
$xml2 .= "<opt_name>{$info['name']}</opt_name>";
    }
}

echo 
"<?php xml version='1.0' encoding='utf-8'?><output>";
echo 
"<catecode>".$xml1."</catecode>";
echo 
"<catename>".$xml2."</catename>";
echo 
"</output>";
?>