/home/mjc1/public_html/onlinecs/mobile/ajax_wish_ch.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
32
33
34
35
36
37
38
<?php
/*$dir = ".";
include_once($dir."/_common.php");*/
@session_start();
include_once(
"./_common.php");

$v_code $_POST['v_code'];
$v_mode $_POST['mode'];
$cuscode $_SESSION['cuscode'];

if(
$cuscode=='' || $v_code==''){

} else {
    include_once(
"./commonST.php");
    
$wish_table_yn 0;
    
$sql "show tables";
    
$res mysql_query($sql);
    while(
$info mysql_fetch_array($res)){
        if(
$info[0]=='custprodinterest'){ $wish_table_yn 1; break; }
    }

    if(
$wish_table_yn==1){ // 즐겨찾기 테이블이 있는지 체크함
        
if($v_mode=='Y'){
            
$sql "insert into custprodinterest set ccode = '$cuscode', pcode = '$v_code' ";
        } else {
            
$sql "delete from custprodinterest where ccode = '$cuscode' and pcode = '$v_code' ";
        }
        
mysql_query($sql);
    }
}

echo 
"<?php xml version='1.0' encoding='utf-8'?><output>";
echo 
"<wish_table_yn>".$wish_table_yn."</wish_table_yn>";
echo 
"<v_code>".$v_code."</v_code>";
echo 
"<v_mode>".$v_mode."</v_mode>";
echo 
"<sql>".$sql."</sql>";
echo 
"</output>";
?>