52 lines
1.0 KiB
PHP
52 lines
1.0 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'];
|
|
$nick=$_REQUEST['nick'];
|
|
$password=$_REQUEST['password'];
|
|
|
|
if ($user_id<>0){
|
|
$sql=mysql_query("select ID from contest_nick where nick='$nick' and pwd='$password' limit 1");
|
|
if (mysql_num_rows($sql))
|
|
{
|
|
$match=1;
|
|
}
|
|
else
|
|
{
|
|
$match=0;
|
|
}
|
|
|
|
if ($match==1){
|
|
$sql=mysql_query("update gcm set cno_ita=0,cno_es=0,cno_eng=0,cno_pt=0,cno_jp=0,cno_zh=0 where user_id=$user_id");
|
|
if ($sql){
|
|
print("ok");
|
|
}
|
|
else{
|
|
print("ko");
|
|
}
|
|
}
|
|
else{
|
|
print("ko");
|
|
}
|
|
}
|
|
else{
|
|
print("ko");
|
|
}
|
|
|
|
mysql_close();
|
|
?>
|