48 lines
1.1 KiB
PHP
48 lines
1.1 KiB
PHP
<?php
|
|
//Parse with sections
|
|
$ini = parse_ini_file("conf.ini", true);
|
|
|
|
mysql_connect($ini['db']['host'],$ini['db']['user'],$ini['db']['pass']);
|
|
mysql_select_db($ini['db']['db']);
|
|
|
|
if ($ini['db']['log']=="1"){
|
|
$arrival_time=microtime(true);
|
|
$filename=basename(__FILE__);
|
|
$filename="log_".$filename.".txt";
|
|
$chunck=strval($arrival_time)." ".$_SERVER['REQUEST_URI']."\r\n";
|
|
file_put_contents($filename,$chunck,FILE_APPEND);
|
|
}
|
|
|
|
mysql_set_charset("utf8");
|
|
|
|
$user_id=$_REQUEST['u_id'];
|
|
$cno_ita=$_REQUEST['cno_ita'];
|
|
$cno_es=$_REQUEST['cno_es'];
|
|
$cno_eng=$_REQUEST['cno_eng'];
|
|
$cno_pt=$_REQUEST['cno_pt'];
|
|
$cno_jp=$_REQUEST['cno_jp'];
|
|
$cno_zh=$_REQUEST['cno_zh'];
|
|
if (!empty($_REQUEST['cno_tag'])){
|
|
$cno_tag=$_REQUEST['cno_tag'];
|
|
}
|
|
else{
|
|
$cno_tag=0;
|
|
}
|
|
|
|
if ($user_id<>0){
|
|
|
|
$sql=mysql_query("update gcm set cno_ita=$cno_ita,cno_es=$cno_es,cno_eng=$cno_eng,cno_pt=$cno_pt,cno_jp=$cno_jp,cno_zh=$cno_zh,cno_tag=$cno_tag where user_id=$user_id");
|
|
if ($sql){
|
|
print("ok");
|
|
}
|
|
else{
|
|
print("ko");
|
|
}
|
|
}
|
|
else{
|
|
print("ko");
|
|
}
|
|
|
|
mysql_close();
|
|
?>
|